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 2016/03/04 18:49:27 UTC
svn commit: r1733622 -
/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
Author: lofwyr
Date: Fri Mar 4 17:49:27 2016
New Revision: 1733622
URL: http://svn.apache.org/viewvc?rev=1733622&view=rev
Log:
TOBAGO-1361: New Layout Manager: Flex Box
- fix JavaScript initialization in AJAX case
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js?rev=1733622&r1=1733621&r2=1733622&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js Fri Mar 4 17:49:27 2016
@@ -207,8 +207,9 @@ function layoutFlex(container, orientati
}
}
-jQuery(document).ready(function () {
- var gridLayouts = jQuery(".tobago-gridLayout");
+Tobago.Layout.init = function (elements) {
+
+ var gridLayouts = Tobago.Utils.selectWithJQuery(elements, ".tobago-gridLayout");
gridLayouts.each(function () {
var table = jQuery(this);
@@ -225,7 +226,7 @@ jQuery(document).ready(function () {
// the flex stuff.
- var flexLayouts = jQuery(".tobago-flexLayout");
+ var flexLayouts = Tobago.Utils.selectWithJQuery(elements, ".tobago-flexLayout");
flexLayouts.each(function () {
var container = jQuery(this);
@@ -239,7 +240,7 @@ jQuery(document).ready(function () {
// XXX Is there a CSS solution?
// TODO: this might be reevaluated after a "resize"
- var header = jQuery(".navbar-fixed-top");
+ var header = Tobago.Utils.selectWithJQuery(elements, ".navbar-fixed-top");
header.each(function () {
var content = header.next();
content.css({
@@ -247,7 +248,7 @@ jQuery(document).ready(function () {
});
});
- var footer = jQuery(".navbar-fixed-bottom");
+ var footer = Tobago.Utils.selectWithJQuery(elements, ".navbar-fixed-bottom");
footer.each(function () {
var content = footer.prev();
content.css({
@@ -255,4 +256,7 @@ jQuery(document).ready(function () {
});
});
-});
+};
+
+Tobago.registerListener(Tobago.Layout.init, Tobago.Phase.DOCUMENT_READY);
+Tobago.registerListener(Tobago.Layout.init, Tobago.Phase.AFTER_UPDATE);