projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed layout of hyperlink_params_td()
[fa-stable.git]
/
js
/
inserts.js
diff --git
a/js/inserts.js
b/js/inserts.js
index b535cd03a361e5841450bf7147785c5213c3a975..d85a9062eacdb8265ac5c5811c2042a0a1e96812 100644
(file)
--- a/
js/inserts.js
+++ b/
js/inserts.js
@@
-74,15
+74,15
@@
function _set_combo_input(e) {
}
}
}
}
}
}
-
};
-
e.onkeydown = function(ev) {
+ };
+ e.onkeydown = function(ev) {
ev = ev||window.event;
key = ev.keyCode||ev.which;
if(key == 13) {
this.blur();
return false;
}
ev = ev||window.event;
key = ev.keyCode||ev.which;
if(key == 13) {
this.blur();
return false;
}
-
}
+ }
}
function _update_box(s) {
}
function _update_box(s) {
@@
-99,13
+99,19
@@
function _update_box(s) {
}
function _set_combo_select(e) {
}
function _set_combo_select(e) {
+ // When combo position is changed via js (eg from searchbox)
+ // no onchange event is generated. To ensure proper change
+ // signaling we must track selectedIndex in onblur handler.
+ e.setAttribute('_last', e.selectedIndex);
e.onblur = function() {
if(this.className=='combo')
_update_box(this);
e.onblur = function() {
if(this.className=='combo')
_update_box(this);
+ if (this.selectedIndex != this.getAttribute('_last'))
+ this.onchange();
}
e.onchange = function() {
var s = this;
}
e.onchange = function() {
var s = this;
-
+ this.setAttribute('_last', this.selectedIndex);
if(s.className=='combo')
_update_box(s);
if(s.selectedIndex>=0) {
if(s.className=='combo')
_update_box(s);
if(s.selectedIndex>=0) {
@@
-155,14
+161,14
@@
var inserts = {
'input.ajaxsubmit,input.editbutton,input.navibutton':
function(e) {
e.onclick = function() {
'input.ajaxsubmit,input.editbutton,input.navibutton':
function(e) {
e.onclick = function() {
- JsHttpRequest.request(this);
- return false;
+
JsHttpRequest.request(this);
+
return false;
}
},
'.amount': function(e) {
if(e.onblur==undefined) {
}
},
'.amount': function(e) {
if(e.onblur==undefined) {
- var dec = e.getAttribute("dec");
e.onblur = function() {
e.onblur = function() {
+ var dec = this.getAttribute("dec");
price_format(this.name, get_amount(this.name), dec);
};
}
price_format(this.name, get_amount(this.name), dec);
};
}