From ae8b1c45fc3ce54242d94c041fef2a884370cc81 Mon Sep 17 00:00:00 2001 From: Eric DeLabar Date: Mon, 2 May 2011 08:22:26 -0700 Subject: [PATCH] The each callback in the pagecreate method was creating multiple calendars when used with a multi-page html file because it was not scoped to the current page but instead to the entire document. --- experiments/ui-datepicker/jquery.ui.datepicker.mobile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js b/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js index 9649cc65..36fa2a9d 100644 --- a/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js +++ b/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js @@ -48,7 +48,7 @@ //bind to pagecreate to automatically enhance date inputs $( ".ui-page" ).live( "pagecreate", function(){ - $( "input[type='date'], input:jqmData(type='date')" ).each(function(){ + $( "input[type='date'], input:jqmData(type='date')", this ).each(function(){ $(this).after( $( "
" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) ); }); });