X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=js%2Finserts.js;h=d0722250769dcb4d3cb25be45586979d34f77f23;hb=1c502501a16dbb08e3f031e3c3a3038540c8b296;hp=de9e8d4aed9546121e5043bd674520d498fb6a31;hpb=9738f7d64641df18b688f0d03a3b62c93f40e0c7;p=fa-stable.git diff --git a/js/inserts.js b/js/inserts.js index de9e8d4a..d0722250 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -153,8 +153,6 @@ function _set_combo_select(e) { var sname = '_'+s.name+'_update'; var update = document.getElementsByName(sname)[0]; if(update) { - if (typeof changeVar === "function") - changeVar(); JsHttpRequest.request(update); } } @@ -316,11 +314,12 @@ var inserts = { e.onclick = function(){ if (validate(e)) { setTimeout(function() { var asp = e.getAttribute('aspect'); - if (asp && asp.indexOf('download') === -1) + 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; @@ -337,9 +336,6 @@ var inserts = { function(e) { e.onclick = function() { if (validate(e)) { - if (typeof changeVar === "function") - changeVar(); - save_focus(e); var asp = e.getAttribute('aspect') if (asp && (asp.indexOf('process') !== -1)) @@ -350,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); + } }; } },