X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Finserts.js;h=40337e7a94a68e7bc2df0c3fa0bfc02e36c289a2;hb=89d9b659abe59b9ee1357b3f08857f8f0e43e425;hp=ccc8024c2d2ca1158dfdfb620c9bb02b18c7ae63;hpb=95ff74b5722826544743a01daf527aa3c9efe11a;p=fa-stable.git diff --git a/js/inserts.js b/js/inserts.js index ccc8024c..40337e7a 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -314,10 +314,12 @@ var inserts = { e.onclick = function(){ if (validate(e)) { setTimeout(function() { var asp = e.getAttribute('aspect'); - set_mark((asp && ((asp.indexOf('process') !== -1) || (asp.indexOf('nonajax') !== -1))) ? 'progressbar.gif' : 'ajax-loader.gif'); + if (asp && asp.indexOf('download') === -1) + set_mark((asp && ((asp.indexOf('process') !== -1) || (asp.indexOf('nonajax') !== -1))) ? 'progressbar.gif' : 'ajax-loader.gif'); }, 100); return true; } + return false; }, e.onkeydown = function(ev) { // block unintentional page escape with 'history back' key pressed on buttons ev = ev||window.event; @@ -344,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); + } }; } },