Author: nbelaevski
Date: 2009-02-04 11:22:31 -0500 (Wed, 04 Feb 2009)
New Revision: 12561
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
https://jira.jboss.org/jira/browse/RF-5933
https://jira.jboss.org/jira/browse/RF-6035
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-04 15:08:24 UTC
(rev 12560)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-04 16:22:31 UTC
(rev 12561)
@@ -142,8 +142,6 @@
this._timeoutID = window.setTimeout(function(){
LOG.warn("request stopped due to timeout");
- _this._oncomplete_aborted = _this._aborted;
-
if(!_this._aborted){
// A4J.AJAX.status(_this.containerId,_this.options.status,false);
if(typeof(A4J.AJAX.onAbort) == "function"){
@@ -170,6 +168,8 @@
},
abort: function(){
+ this._oncomplete_aborted = true;
+
if(!this._aborted){
if(typeof(A4J.AJAX.onAbort) == "function"){
A4J.AJAX.onAbort(this);
@@ -1285,30 +1285,39 @@
// on stop - inverse.
A4J.AJAX.status = function(regionID,targetID,start){
try {
- var elem;
targetID = targetID || regionID +":status";
A4J.AJAX._requestsCounts[targetID]=(A4J.AJAX._requestsCounts[targetID]||0)+(start?1:-1);
- if(A4J.AJAX._requestsCounts[targetID]>0){
- elem = document.getElementById(targetID+".stop");
- if(elem){elem.style.display="none";}
- elem = document.getElementById(targetID+".start");
- if(elem){
- elem.style.display="";
- if(typeof(elem.onstart) == 'function'){
- elem.onstart();
- }
+
+ var startElem = document.getElementById(targetID + ".start");
+ var stopElem = document.getElementById(targetID + ".stop");
+
+ if(A4J.AJAX._requestsCounts[targetID] > 0){
+ if (stopElem) {
+ stopElem.style.display = "none";
}
- }else{
- elem = document.getElementById(targetID+".start");
- if(elem){elem.style.display="none";}
- elem = document.getElementById(targetID+".stop");
- if(elem){
- elem.style.display="";
- if(typeof(elem.onstop) == 'function'){
- elem.onstop();
- }
+
+ if (startElem) {
+ startElem.style.display = "";
}
+ } else {
+ if (startElem) {
+ startElem.style.display = "none";
+ }
+
+ if (stopElem) {
+ stopElem.style.display = "";
+ }
}
+
+ if (start) {
+ if (startElem && (typeof(startElem.onstart) == 'function')) {
+ startElem.onstart();
+ }
+ } else {
+ if (stopElem && (typeof(stopElem.onstop) == 'function')) {
+ stopElem.onstop();
+ }
+ }
} catch(e){
LOG.error("Exception on status change: ");
}