X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Finserts.js;h=a6365d7578d42beb5270ff288b2254b330c9a13b;hb=7286bbfc939360b0fcb573ae075b2b8e899d96c8;hp=cebb2a438bae3bd2d930c3147620c4a50d73937b;hpb=883307779f9ca5bac0533702a8702b0cccb4742f;p=fa-stable.git diff --git a/js/inserts.js b/js/inserts.js index cebb2a43..a6365d75 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -53,8 +53,9 @@ function _set_combo_input(e) { save_focus(select); // submit request if there is submit_on_change option set and // search field has changed. + if (button && (this.value != this.getAttribute('_last'))) { - JsHttpRequest.request(button); + JsHttpRequest.request(button); } else if(this.className=='combo2') { this.style.display = 'none'; select.style.display = 'inline'; @@ -95,8 +96,10 @@ function _update_box(s) { if(box && s.selectedIndex>=0) { var opt = s.options[s.selectedIndex]; if(box) { + var old = box.value; box.value = byid ? opt.value : opt.text; box.setAttribute('_last', box.value); + return old != box.value } } } @@ -107,10 +110,13 @@ function _set_combo_select(e) { // signaling we must track selectedIndex in onblur handler. e.setAttribute('_last', e.selectedIndex); e.onblur = function() { - if(this.className=='combo') - _update_box(this); - if (this.selectedIndex != this.getAttribute('_last')) - this.onchange(); + var box = document.getElementsByName(this.getAttribute('rel'))[0]; +// if(this.className=='combo') +// _update_box(this); + if ((this.selectedIndex != this.getAttribute('_last')) + ||(this.className=='combo' && _update_box(this)) + ) + this.onchange(); } e.onchange = function() { var s = this; @@ -214,7 +220,7 @@ var inserts = { e.onclick = function() { save_focus(e); if (e.getAttribute('aspect') == 'process') - JsHttpRequest.request(this, null, 30000); + JsHttpRequest.request(this, null, 60000); else JsHttpRequest.request(this); return false; @@ -258,12 +264,29 @@ var inserts = { } } }, - 'button[aspect=selector], input[aspect=selector]': function(e) { + 'button[aspect=selector], button[aspect=abort], input[aspect=selector]': function(e) { e.onclick = function() { passBack(this.getAttribute('rel')); return false; } }, + 'button[aspect=popup]': function(e) { + var old = e.onclick + e.onclick = function() { +// this.form.target = '_blank'; +// old(); +// return true; + if(_w) _w.close(); // this is really necessary to have window on top in FF2 :/ + _w = open(document.location+'popup=1', + "edit","Scrollbars=0,resizable=0,width=800,height=600, top=50,left=50"); + if (_w.opener == null) + _w.opener = self; + // editors._call = key; // store call point for passBack +// _w.moveTo(50, 50); + _w.focus(); + return false; + } + }, 'select': function(e) { if(e.onfocus==undefined) { e.onfocus = function() { @@ -357,7 +380,7 @@ function setHotKeys() { _hotkeys.focus = -1; return stopEv(ev); } - else if (_hotkeys.alt && ((key>47 && key<58) || (key>64 && key<91))) { + else if (ev.altKey && !ev.ctrlKey && ((key>47 && key<58) || (key>64 && key<91))) { var n = _hotkeys.focus; var l = document.links; var cnt = l.length; @@ -375,7 +398,7 @@ function setHotKeys() { } return stopEv(ev); } - if((ev.ctrlKey && key == 13) || key == 27) { + if((ev.ctrlKey && key == 13) || (key == 27 && ev.altKey)) { _hotkeys.alt = false; // cancel link selection _hotkeys.focus = -1; ev.cancelBubble = true;