From 773497b5011e39fc102844b86307f1f363ee41a0 Mon Sep 17 00:00:00 2001 From: "jblas@adobe.com" Date: Thu, 13 Oct 2011 22:45:52 -0700 Subject: [PATCH] Fixed #2348 - lists-search-with-dividers breaks fixed footer - Fixed header/footer code now listens for a custom event "contentmodified" on the document to figure out if it should be repositioned or not. Modified collapsible and listview to fire off contentmodified whenever they modify content. Developers can also fire off this event to trigger position updates for fixed headers/footers, so this could be used to address issue #2042 and the mention of collapsible in #2596. --- js/jquery.mobile.collapsible.js | 1 + js/jquery.mobile.fixHeaderFooter.js | 2 +- js/jquery.mobile.listview.js | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.collapsible.js b/js/jquery.mobile.collapsible.js index a416276e..7614713f 100644 --- a/js/jquery.mobile.collapsible.js +++ b/js/jquery.mobile.collapsible.js @@ -135,6 +135,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { .toggleClass( "ui-corner-bottom", isCollapse ); collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse ); } + collapsibleContent.trigger( "contentmodified" ); } }) .trigger( o.collapsed ? "collapse" : "expand" ); diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 5aca7d7c..4c093208 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -148,7 +148,7 @@ $.mobile.fixedToolbars = (function() { stateBefore = null; }); - $window.bind( "resize", showEventCallback ); + $window.bind( "resize contentmodified", showEventCallback ); }); // 1. Before page is shown, check for duplicate footer diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 62c66d35..eb543238 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -106,6 +106,9 @@ $.widget( "mobile.listview", $.mobile.widget, { .not(".ui-li-icon") .addClass( "ui-corner-bl" ); } + if ( !create ) { + this.element.trigger( "contentmodified" ); + } }, refresh: function( create ) {