You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/06/11 09:44:55 UTC

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

Author: bommel
Date: Wed Jun 11 00:44:54 2008
New Revision: 666553

URL: http://svn.apache.org/viewvc?rev=666553&view=rev
Log:
(TOBAGO-675) A redisplayed popup blocks the page

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

Modified: myfaces/tobago/branches/tobago-1.0.x/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-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=666553&r1=666552&r2=666553&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Jun 11 00:44:54 2008
@@ -226,7 +226,7 @@
   /**
     * Count of currently open popups
     */
-  openPopups: 0,
+  openPopups: new Array(),
 
   // -------- Functions -------------------------------------------------------
 
@@ -461,8 +461,8 @@
       transition = true;
     }
     LOG.info("transition =" + transition);
-
-    if (Tobago.openPopups > 0) {
+    //LOG.inof("submitAction OpenPopups " + Tobago.openPopups);
+    if (Tobago.openPopups.length > 0) {
       // enable all elements on page when this is a submit from a popup
       // (disabled input elements are not submitted)
       for (i = 0; i < document.forms[0].elements.length; i++) {
@@ -915,10 +915,28 @@
       // Popup is loaded during page loading
       Tobago.initialPopupId = id;
     } else {
-      // Popup is loaded by ajax
-      Tobago.lockPopupPage(id); 
+      //LOG.info("setup Popups " + Tobago.openPopups);
+      var contains = false;
+      for(var i = 0; i < Tobago.openPopups.length; i++) {
+        if (Tobago.openPopups[i] == id) {
+          contains = true;
+        }
+      }
+      if (!contains) {
+        // Popup is loaded by ajax
+        Tobago.lockPopupPage(id);
+      }
+    }
+    var contains = false;
+    for(var i = 0; i < Tobago.openPopups.length; i++) {
+      if (Tobago.openPopups[i] == id) {
+        contains = true;
+      }
+    }
+    if (!contains) {
+      Tobago.openPopups.push(id);
     }
-    Tobago.openPopups++;
+
   },
  
   /**
@@ -1038,11 +1056,13 @@
     Tobago.removeEventListener(window, "resize", Tobago.popupResizeStub);
     Tobago.popupResizeStub = null;
     
+    //LOG.info("unlockPopupPage " + id);
     Tobago.unlockPopupPage(id);
-    Tobago.openPopups--;
-    
+    Tobago.openPopups.pop();
+    //LOG.info("OpenPopupCount " + Tobago.openPopups);
+
     // reset focus when last popup was closed
-    if (Tobago.openPopups == 0) {
+    if (Tobago.openPopups.length == 0) {
       Tobago.setFocus();
     }
   },