projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c08cb63
)
Fixed ajax popup flicker.
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Thu, 23 Oct 2008 17:18:21 +0000
(17:18 +0000)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Thu, 23 Oct 2008 17:18:21 +0000
(17:18 +0000)
js/utils.js
patch
|
blob
|
history
diff --git
a/js/utils.js
b/js/utils.js
index e0ab74a61826c897402586151c0c7e6e427fea2c..31a7e7d4988cf6d4ea32d57c480a7793387fb391 100644
(file)
--- a/
js/utils.js
+++ b/
js/utils.js
@@
-15,6
+15,7
@@
var content = {};
var upload = 0;
var url = trigger.href;
var content = {};
var upload = 0;
var url = trigger.href;
+ if (trigger.id) content[trigger.id] = 1;
} else {
var submitObj = typeof(trigger) == "string" ?
document.getElementsByName(trigger)[0] : trigger;
} else {
var submitObj = typeof(trigger) == "string" ?
document.getElementsByName(trigger)[0] : trigger;
@@
-43,6
+44,7
@@
// Function is called when an answer arrives.
function(result, errors) {
// Write the answer.
// Function is called when an answer arrives.
function(result, errors) {
// Write the answer.
+ var newwin = 0;
if (result) {
for(var i in result ) {
atom = result[i];
if (result) {
for(var i in result ) {
atom = result[i];
@@
-71,6
+73,7
@@
} else if(cmd=='rd') { // client-side redirection
window.location = data;
} else if(cmd=='pu') { // pop-up
} else if(cmd=='rd') { // client-side redirection
window.location = data;
} else if(cmd=='pu') { // pop-up
+ newwin = 1;
window.open(data,'REP_WINDOW','toolbar=no,scrollbar=no,resizable=yes,menubar=no');
} else {
errors = errors+'<br>Unknown ajax function: '+cmd;
window.open(data,'REP_WINDOW','toolbar=no,scrollbar=no,resizable=yes,menubar=no');
} else {
errors = errors+'<br>Unknown ajax function: '+cmd;
@@
-87,7
+90,9
@@
window.scrollTo(0,0);
//document.getElementById('msgbox').scrollIntoView(true);
// Restore focus if we've just lost focus because of DOM element refresh
window.scrollTo(0,0);
//document.getElementById('msgbox').scrollIntoView(true);
// Restore focus if we've just lost focus because of DOM element refresh
- setFocus();
+ if(!newwin) {
+ setFocus();
+ }
}
},
false // do not disable caching
}
},
false // do not disable caching