You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2016/01/25 12:27:31 UTC
svn commit: r1726610 -
/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Author: weber
Date: Mon Jan 25 11:27:30 2016
New Revision: 1726610
URL: http://svn.apache.org/viewvc?rev=1726610&view=rev
Log:
TOBAGO-1522 - AJAX-Overlay never disappears when heavily double clicking
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1726610&r1=1726609&r2=1726610&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Mon Jan 25 11:27:30 2016
@@ -1846,7 +1846,7 @@ Tobago.Transport = {
},
/**
- * @return true if the request is queued or ignored, because of a double request.
+ * @return true if the request is queued.
*/
request: function(req, submitPage, actionId) {
var index = 0;
@@ -1857,23 +1857,24 @@ Tobago.Transport = {
} else if (!this.pageSubmitted) { // AJAX case
console.debug('Current ActionId = ' + this.currentActionId + ' action= ' + actionId); // @DEV_ONLY
if (actionId && this.currentActionId == actionId) {
- console.debug('Ignoring request'); // @DEV_ONLY
+ console.info('Ignoring request'); // @DEV_ONLY
// If actionId equals currentActionId assume double request: do nothing
- return true;
+ return false;
}
index = this.requests.push(req);
//console.debug('index = ' + index)
this.currentActionId = actionId;
} else {
+ console.warn("ELSE?") // @DEV_ONLY
return false;
}
- //console.debug('index = ' + index)
+ console.debug('index = ' + index) // @DEV_ONLY
if (index == 1) {
- console.debug('Execute request!'); // @DEV_ONLY
+ console.info('Execute request!'); // @DEV_ONLY
this.startTime = new Date().getTime();
this.requests[0]();
} else {
- console.debug('Request queued!'); // @DEV_ONLY
+ console.info('Request queued!'); // @DEV_ONLY
}
return true;
},
@@ -2048,25 +2049,8 @@ Tobago.Updater = {
requestOptions.url = form.attr("action");
}
- var ids;
- if (requestOptions.createOverlay) {
- ids = Tobago.parsePartialIds(ajaxComponentIds);
- for (var i = 0; i < ids.length; i++) {
- var id = ids[i];
- var container = Tobago.ajaxComponents[id];
- if (container && typeof container.prepareReload == 'function') {
- container.prepareReload();
- } else if (container) {
- container.overlay({error: false, ajax: true});
- } else {
- jQuery(Tobago.Utils.escapeClientId(id)).overlay({error: false, ajax: true});
- }
- }
- }
-
Tobago.setActionPosition(source);
-
if (!Tobago.partialRequestIds) {
var hidden = document.createElement('input');
hidden.type = 'hidden';
@@ -2079,8 +2063,21 @@ Tobago.Updater = {
Tobago.storeClientDimension();
if (!Tobago.Transport.ajaxTransport.request(requestOptions)) {
- console.error('Page was submitted, request not queued!'); // @DEV_ONLY
- Tobago.Updater.handleMissingResponses(ajaxComponentIds, {});
+ console.error('Page was already submitted, request not queued!'); // @DEV_ONLY
+ } else {
+ if (requestOptions.createOverlay) {
+ var ids = Tobago.parsePartialIds(ajaxComponentIds);
+ for (i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var container = Tobago.ajaxComponents[id];
+ if (container) {
+ container.overlay({error: false, ajax: true});
+ } else {
+ jQuery(Tobago.Utils.escapeClientId(id)).overlay({error: false, ajax: true});
+ }
+ console.info("OVERLAY for " + id); // @DEV_ONLY
+ }
+ }
}
} else {
console.info('No Ajax transport found! Doing full page reload.'); // @DEV_ONLY