Add contract parts
add procurement create prevent enter to product field
This commit is contained in:
26
backend/web/js/app.js
Normal file
26
backend/web/js/app.js
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
|
||||
function doPreventSubmit($selector){
|
||||
$($selector).keydown(function(e) {
|
||||
if(e.keyCode == 13) { // enter key was pressed
|
||||
e.preventDefault();
|
||||
// run own code
|
||||
return false; // prevent execution of rest of the script + event propagation / event bubbling + prevent default behaviour
|
||||
}
|
||||
});
|
||||
$($selector).keyup(function(e) {
|
||||
if(e.keyCode == 13) { // enter key was pressed
|
||||
e.preventDefault();
|
||||
// run own code
|
||||
return false; // prevent execution of rest of the script + event propagation / event bubbling + prevent default behaviour
|
||||
}
|
||||
});
|
||||
$($selector).keypress(function(e) {
|
||||
if(e.keyCode == 13) { // enter key was pressed
|
||||
e.preventDefault();
|
||||
// run own code
|
||||
return false; // prevent execution of rest of the script + event propagation / event bubbling + prevent default behaviour
|
||||
}
|
||||
});
|
||||
}
|
||||
25
backend/web/js/procurement.create.js
Normal file
25
backend/web/js/procurement.create.js
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
function ProcurementCreate(o){
|
||||
|
||||
var defaults = {
|
||||
'selector_product' : '#procurement-productidentifier',
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
function init(){
|
||||
defaults = $.extend(defaults,o);
|
||||
console.info(defaults);
|
||||
addPreventEnterToProduct();
|
||||
}
|
||||
|
||||
|
||||
function addPreventEnterToProduct(){
|
||||
doPreventSubmit($(defaults.selector_product));
|
||||
console.info('event handler added');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user