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 2017/03/14 14:11:21 UTC

svn commit: r1786905 - /myfaces/tobago/branches/tobago-2.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Author: weber
Date: Tue Mar 14 14:11:21 2017
New Revision: 1786905

URL: http://svn.apache.org/viewvc?rev=1786905&view=rev
Log:
TOBAGO-1716 - Tobago 2: enable javascript after ajax submit with notModified response

Modified:
    myfaces/tobago/branches/tobago-2.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-2.0.x/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/branches/tobago-2.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1786905&r1=1786904&r2=1786905&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-2.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-2.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Tue Mar 14 14:11:21 2017
@@ -151,6 +151,7 @@ var Tobago = {
     windowLoad: [[], [], [], []],
     beforeSubmit: [[], [], [], []],
     afterUpdate: [[], [], [], []],
+    afterNotModified: [[], [], [], []],
     beforeUnload: [[], [], [], []],
     beforeExit: [[], [], [], []]
   },
@@ -178,6 +179,8 @@ var Tobago = {
       phaseMap = Tobago.listeners.beforeSubmit;
     } else if (Tobago.Phase.AFTER_UPDATE == phase) {
       phaseMap = Tobago.listeners.afterUpdate;
+    } else if (Tobago.Phase.AFTER_NOT_MODIFIED == phase) {
+      phaseMap = Tobago.listeners.afterNotModified;
     } else if (Tobago.Phase.BEFORE_UNLOAD == phase) {
       phaseMap = Tobago.listeners.beforeUnload;
     } else if (Tobago.Phase.BEFORE_EXIT == phase) {
@@ -1607,6 +1610,8 @@ Tobago.Phase = {
   BEFORE_SUBMIT:{},
   /** after an AJAX call */
   AFTER_UPDATE:{},
+  /** after an AJAX call without update */
+  AFTER_NOT_MODIFIED:{},
   /** before ending a page */
   BEFORE_UNLOAD:{},
   /** before closing a window or tab */
@@ -2329,6 +2334,13 @@ Tobago.Updater = {
         if (typeof this.afterDoUpdateNotModified == 'function') {
           this.afterDoUpdateNotModified();
         }
+        for (order = 0; order < Tobago.listeners.afterNotModified.length; order++) {
+          list = Tobago.listeners.afterNotModified[order];
+          for (i = 0; i < list.length; i++) {
+            list[i](newElement);
+          }
+        }
+
         if (overlay.data("tobagoOverlay") != null) {
           overlay.overlay("destroy");
         }