X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Finserts.js;h=40337e7a94a68e7bc2df0c3fa0bfc02e36c289a2;hb=45aa0f7f7e8a8683305bbdbc58fdb3b791d2115e;hp=17b71143b60187ac01455c2be1c0031b1f69d255;hpb=a5edfc9244a2b1f478269a1b276cbf2236ec6cc3;p=fa-stable.git diff --git a/js/inserts.js b/js/inserts.js index 17b71143..40337e7a 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -319,6 +319,7 @@ var inserts = { }, 100); return true; } + return false; }, e.onkeydown = function(ev) { // block unintentional page escape with 'history back' key pressed on buttons ev = ev||window.event; @@ -345,11 +346,18 @@ var inserts = { return false; } }, - '.amount': function(e) { - if(e.onblur==undefined) { + '.amount': function(e) { + if (e.onblur == undefined) { + e.setAttribute('_last_val', e.value); e.onblur = function() { var dec = this.getAttribute("dec"); - price_format(this.name, get_amount(this.name), dec); + var val = this.getAttribute('_last_val'); + if (val != get_amount(this.name)) { + this.setAttribute('_last_val', get_amount(this.name)); + price_format(this.name, get_amount(this.name), dec); + if (e.className.match(/\bactive\b/)) + JsHttpRequest.request('_'+this.name+'_changed', this.form); + } }; } },