X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Finserts.js;h=0c40deb8e8f5c51b091293a2fce6c8b757773b07;hb=7e6e0807990447d2977b970c3a0fd28dc9250194;hp=e1762dd37b1ba43836d72eb771fa70b16f8a8110;hpb=e9ad9e87f5eb2682d2e91c93134250fd8a8d2ad9;p=fa-stable.git diff --git a/js/inserts.js b/js/inserts.js index e1762dd3..0c40deb8 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 && asp.indexOf('popup') === -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); + } }; } }, @@ -469,7 +478,7 @@ var inserts = { var tab=ulist[x].getElementsByTagName("button")[0]; var url = tab.form.action tab.onclick=function(){ - if (!_hotkeys.alt && !tab.disabled) + if (!_hotkeys.alt && !this.disabled) _expand(this); return false; } @@ -571,7 +580,7 @@ function setHotKeys() { ev.returnValue = false; return false; } - if (editors!=='undefined' && editors[key]) { + if (editors!==undefined && editors[key]) { callEditor(key); return stopEv(ev); // prevent default binding }