Skip to content
This repository
Browse code

bound widgets to the "enhance" event, in addition to the pagecreate e…

…vent. The enhance event allows developers to enhance the contents of an html fragment by triggering "enhance".
  • Loading branch information...
commit 64e6ef0e720a448e8862246ffeaa504ea5e8ac78 1 parent 2a6c7fc
authored July 19, 2011
2  js/jquery.mobile.buttonMarkup.js
@@ -140,7 +140,7 @@ var attachEvents = function() {
140 140
 
141 141
 //links in bars, or those with  data-role become buttons
142 142
 //auto self-init widgets
143  
-$( document ).bind( "pagecreate", function( e ){
  143
+$( document ).bind( "pagecreate enhance", function( e ){
144 144
 
145 145
 	$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a", e.target )
146 146
 		.not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
2  js/jquery.mobile.collapsible.js
@@ -7,7 +7,7 @@
7 7
 (function( $, undefined ) {
8 8
 
9 9
 //auto self-init widgets
10  
-$( document ).bind( "pagecreate", function( e ){
  10
+$( document ).bind( "pagecreate enhance", function( e ){
11 11
 	$( ":jqmData(role='collapsible')", e.target ).collapsible();
12 12
 });
13 13
 
2  js/jquery.mobile.controlGroup.js
@@ -7,7 +7,7 @@
7 7
 (function( $, undefined ) {
8 8
 
9 9
 //auto self-init widgets
10  
-$( document ).bind( "pagecreate", function( e ){
  10
+$( document ).bind( "pagecreate enhance", function( e ){
11 11
 	$( ":jqmData(role='controlgroup')", e.target ).controlgroup({ excludeInvisible: false });
12 12
 });
13 13
 
2  js/jquery.mobile.fieldContain.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( ":jqmData(role='fieldcontain')", e.target ).fieldcontain();
13 13
 });
14 14
 
2  js/jquery.mobile.fixHeaderFooter.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 	
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	
13 13
 	if( $( ":jqmData(position='fixed')", e.target ).length ){
14 14
 		$( e.target ).each(function(){
2  js/jquery.mobile.forms.button.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( "button, [type='button'], [type='submit'], [type='reset'], [type='image']", e.target )
13 13
 		.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
14 14
 		.button();
2  js/jquery.mobile.forms.checkboxradio.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( "input[type='checkbox'],input[type='radio']", e.target )
13 13
 		.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
14 14
 		.checkboxradio();
2  js/jquery.mobile.forms.select.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( "select:not(:jqmData(role='slider'))", e.target )
13 13
 		.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
14 14
 		.selectmenu();
2  js/jquery.mobile.forms.slider.js
@@ -8,7 +8,7 @@
8 8
 ( function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 
13 13
 	var nativeSel = ":jqmData(role='none'), :jqmData(role='nojs')";
14 14
 
2  js/jquery.mobile.forms.textinput.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( "input[type='text'], input[type='search'], input[type='number'], input[type='password'], textarea", e.target )
13 13
 		.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
14 14
 		.textinput();
2  js/jquery.mobile.links.js
@@ -7,7 +7,7 @@
2  js/jquery.mobile.listview.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( ":jqmData(role='listview')", e.target ).listview();
13 13
 });
14 14
 
2  js/jquery.mobile.navbar.js
@@ -8,7 +8,7 @@
8 8
 (function( $, undefined ) {
9 9
 
10 10
 //auto self-init widgets
11  
-$( document ).bind( "pagecreate", function( e ){
  11
+$( document ).bind( "pagecreate enhance", function( e ){
12 12
 	$( ":jqmData(role='navbar')", e.target ).navbar();
13 13
 });
14 14
 
2  js/jquery.mobile.nojs.js
@@ -7,7 +7,7 @@
7 7
 
8 8
 (function( $, undefined ) {
9 9
 
10  
-$( document ).bind( "pagecreate", function( e ){
  10
+$( document ).bind( "pagecreate enhance", function( e ){
11 11
 	$( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
12 12
 	
13 13
 });
6  tests/unit/checkboxradio/checkboxradio_core.js
@@ -109,4 +109,10 @@
109 109
 		], 500);
110 110
 
111 111
 	});
  112
+	
  113
+	test( "checkboxradio controls will create when inside a container that receives an 'enhance' event", function(){
  114
+		ok( $("#fragment").appendTo(".ui-page-active").find(".ui-btn").length );
  115
+	})
  116
+	
  117
+	
112 118
 })(jQuery);

0 notes on commit 64e6ef0

Please sign in to comment.
Something went wrong with that request. Please try again.