You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/03/29 18:46:07 UTC

svn commit: r928832 - /myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Author: lofwyr
Date: Mon Mar 29 16:46:07 2010
New Revision: 928832

URL: http://svn.apache.org/viewvc?rev=928832&view=rev
Log:
TOBAGO-134: Clean up

Modified:
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/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/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=928832&r1=928831&r2=928832&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Mon Mar 29 16:46:07 2010
@@ -1079,25 +1079,16 @@ var Tobago = {
   },
 
   openPopupWithAction: function(source, popupId, actionId, options) {
-    var div = Tobago.element(popupId);
-    if (div) {
-      LOG.warn("something is wrong, doing full reload");
-//      LOG.info("id = " + popupId + "  type = " + div.tagName + "  class = " + div.className);
-      Tobago.submitAction(source, actionId);
-    }
 
-    div = document.createElement('div');
-    div.id = popupId + "parentDiv";
-    div.className = "tobago-popup-parent";
-    LOG.debug('adding div');
-    if (Tobago.element(div.id)) {
-      LOG.debug('found element' + div.id);
-    } else {
-      LOG.debug('add element' + div.id);
-      Tobago.form.appendChild(div);
+    // If there is no div, create one.
+    var div = jQuery(Tobago.escapeClientId(popupId));
+    if (div.size() == 0) {
+      jQuery("form:first") // add the new div after the page and the popup divs.
+          .children("(.tobago-page-default,.tobago-popup-default):last")
+          .after("<div id='" + popupId + "'");
     }
 
-    Tobago.addAjaxComponent(popupId, div.id);
+    Tobago.addAjaxComponent(popupId);
     Tobago.reloadComponent(source, popupId, actionId, options);
   },