Merge branch 'master' into fastclick

This commit is contained in:
Kin Blas 2011-02-25 20:41:09 -08:00
commit 730dae0fc1
4 changed files with 32 additions and 16 deletions

View file

@ -8,15 +8,15 @@
//cache previous datepicker ui method
var prevDp = $.fn.datepicker;
//rewrite datepicker
$.fn.datepicker = function( options ){
var dp = this;
//call cached datepicker plugin
prevDp.call( this, options );
//extend with some dom manipulation to update the markup for jQM
//call immediately
function updateDatepicker(){
@ -26,30 +26,30 @@
$( ".ui-datepicker-next", dp ).buttonMarkup({iconpos: "notext", icon: "arrow-r", shadow: true, corners: true});
$( ".ui-datepicker-calendar th", dp ).addClass("ui-bar-c");
$( ".ui-datepicker-calendar td", dp ).addClass("ui-body-c");
$( ".ui-datepicker-calendar a", dp ).buttonMarkup({corners: false, shadow: false});
$( ".ui-datepicker-calendar a", dp ).buttonMarkup({corners: false, shadow: false});
$( ".ui-datepicker-calendar a.ui-state-active", dp ).addClass("ui-btn-active"); // selected date
$( ".ui-datepicker-calendar a.ui-state-highlight", dp ).addClass("ui-btn-up-e"); // today"s date
$( ".ui-datepicker-calendar .ui-btn", dp ).each(function(){
var el = $(this);
// remove extra button markup - necessary for date value to be interpreted correctly
el.html( el.find( ".ui-btn-text" ).text() );
el.html( el.find( ".ui-btn-text" ).text() );
});
};
//update now
updateDatepicker();
// and on click
$( dp ).click( updateDatepicker );
//return jqm obj
//return jqm obj
return this;
};
//bind to pagecreate to automatically enhance date inputs
$( ".ui-page" ).live( "pagecreate", function(){
$( "input[type='date'], input[data-type='date']" ).each(function(){
//bind to pagecreate to automatically enhance date inputs
$( ".ui-page" ).live( "pagecreate", function(){
$( "input[type='date'], input[data-type='date']", this ).each(function(){
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) );
});
});
});
})( jQuery );

View file

@ -45,7 +45,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
var oe = event.originalEvent.touches[0];
if( label.data("movestart") ){
if( Math.abs( label.data("movestart")[0] - oe.pageX ) > 10 ||
Math.abs( abel.data("movestart")[1] - oe.pageY ) > 10 ){
Math.abs( label.data("movestart")[1] - oe.pageY ) > 10 ){
label.data("moved", true);
}
}

View file

@ -513,6 +513,7 @@
url: fileUrl,
type: type,
data: data,
dataType: "html",
success: function( html ) {
//pre-parse html to check for a data-url,
//use it as the new fileUrl, base path, etc

View file

@ -252,4 +252,19 @@
start();
}, 1000);
});
asyncTest( "Dividers are hidden when preceding hidden rows and shown when preceding shown rows", function () {
// wait for the page to become active/enhanced
setTimeout(function(){
$('.ui-page-active input').val('at');
$('.ui-page-active input').trigger('change');
}, 500);
setTimeout(function() {
same($('.ui-page-active li[data-role=list-divider][style^="display: none;"]').length, 2);
same($('.ui-page-active li[data-role=list-divider][style^="display: none;"] + li:not([data-role=list-divider])[style^="display: none;"]').length, 2);
same($('.ui-page-active li[data-role=list-divider]:not([style^="display: none;"]) + li:not([data-role=list-divider]):not([style^="display: none;"])').length, 2);
start();
}, 1000);
});
})(jQuery);