jqueryDayField: do nothing if <input type=date> supported

On iOS 5, for example, <input type=date> throws up a native date picker,
so there's no reason to show the jquery-ui datepicker.

This is not perfect, because the jquery-ui JavaScript and CSS are still
loaded, and the JqueryDaySettings are not turned into attributes on the
<input>, but it's a start.
This commit is contained in:
Will Thompson 2012-01-05 09:29:06 +00:00
parent 74b1dc4a77
commit 94e4cf0213

View File

@ -86,13 +86,18 @@ jqueryDayField jds = Field
addScript' urlJqueryUiJs addScript' urlJqueryUiJs
addStylesheet' urlJqueryUiCss addStylesheet' urlJqueryUiCss
addJulius [JULIUS| addJulius [JULIUS|
$(function(){$("##{theId}").datepicker({ $(function(){
dateFormat:'yy-mm-dd', var i = $("##{theId}");
changeMonth:#{jsBool $ jdsChangeMonth jds}, if (i.attr("type") != "date") {
changeYear:#{jsBool $ jdsChangeYear jds}, i.datepicker({
numberOfMonths:#{mos $ jdsNumberOfMonths jds}, dateFormat:'yy-mm-dd',
yearRange:"#{jdsYearRange jds}" changeMonth:#{jsBool $ jdsChangeMonth jds},
})}); changeYear:#{jsBool $ jdsChangeYear jds},
numberOfMonths:#{mos $ jdsNumberOfMonths jds},
yearRange:"#{jdsYearRange jds}"
});
}
});
|] |]
} }
where where