jquery/jquery-mobile — pull request #6624 by allsteady (2013-10-18 04:55:02+00:00)
Title: The Filterable have not worked properly when filter-reveal type is 'true' in some case.

Hi All :)

I found a irregular operation when widget type is the reveal(data-filter-reveal='true').
Some filtered items are displayed and some operations are not worked.
If you visit below url, You will see a abnormal screen.
( http://hyunsook.github.io/jqm-debug/latest/filterable.html#revelMode )

This bug is caused by the order of widget creation.
If you visit below url, you can get a more information about the bug.
( https://docs.google.com/presentation/d/1USqM07bXIUWf0EDh5BC-aOMAMMuU5F0mWVB3fjVyrCs/edit?usp=sharing )

We have two solutions.
First solution is that we change the defined order of widgets in js file (jquery.mobile.js).

The other solution is that we call 'refresh(some modified)' handler in pagebeforeshow event.

Example( in filterable.js )

// in filterable.js
_create: function() {
var self = this,
opts = this.options;

$.extend( this, {
_search: null,
_timer: 0
});
this._setInput( opts.input );

// this code.
if ( opts.filterReveal ) {
$( document ).one( "pagebeforeshow", function ( event ) {
var items = self._getFilterableItems();
if ( !items.hasClass ("ui-screen-hidden") ) {
self.element.find(".ui-screen-hidden")
.removeClass("ui-screen-hidden");
items.addClass("ui-screen-hidden");
}
});
}

if ( !opts.enhanced ) {
this._filterItems( ( ( this._search && this._search.val() ) || "" ).toLowerCase() );
}
},

If there are any problems or mistakes on that PR, please let me know. Thanks in advance.