Permalink
Browse files

bound widgets to the "enhance" event too, which can now be called on …

…an arbitrary parent element to trigger enhancements on child HTML.
  • Loading branch information...
1 parent b62a510 commit df92fbd591ac2ed5c3a8336b1bbef130d1bc0b25 scottjehl committed Jun 9, 2011
@@ -135,7 +135,7 @@ var attachEvents = function() {
//links in bars, or those with data-role become buttons
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
var exclude = ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')";
@@ -7,7 +7,7 @@
( function( $, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( "jqmData(role='collapsible')", e.target ).collapsible();
});
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( ":jqmData(role='controlgroup')", e.target ).controlgroup();
});
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( ":jqmData(role='fieldcontain')", e.target ).fieldcontain();
});
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( "button, [type='button'], [type='submit'], [type='reset'], [type='image']", e.target )
.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
.button();
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( "input[type='checkbox'],input[type='radio']", e.target )
.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
.checkboxradio();
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( "select:not(:jqmData(role='slider'))", e.target )
.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
.selectmenu();
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
var nativeSel = ":jqmData(role='none'), :jqmData(role='nojs')";
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( "input[type='text'], input[type='search'], input[type='number'], input[type='password'], textarea", e.target )
.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
.textinput();
@@ -9,7 +9,7 @@
$.mobile.listview.prototype.options.filter = false;
$.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
-$( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
+$( ":jqmData(role='listview')" ).live( "listviewcreate enhance", function() {
var list = $( this ),
listview = list.data( "listview" );
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( ":jqmData(role='listview')", e.target ).listview();
});
@@ -7,7 +7,7 @@
(function($, undefined ) {
//auto self-init widgets
-$( document ).bind( "pagecreate", function( e ){
+$( document ).bind( "pagecreate enhance", function( e ){
$( ":jqmData(role='navbar')", e.target ).navbar();
});

0 comments on commit df92fbd

Please sign in to comment.