Merge pull request #2047 from johnnyreilly/master

jQueryUI: started adding option overloads
This commit is contained in:
John Reilly
2014-04-16 17:00:02 +01:00
2 changed files with 81 additions and 7 deletions
+23
View File
@@ -1153,6 +1153,29 @@ function test_datepicker() {
var $setDate2: JQuery = $(".selector").datepicker("setDate", new Date());
var $shown: JQuery = $(".selector").datepicker("show");
var $widget: JQuery = $(".selector").datepicker("widget");
// Options
function altField() {
$(".selector").datepicker({ altField: "#actualDate" });
// getter
var altField: any = $(".selector").datepicker("option", "altField");
// setter
var $set: JQuery = $(".selector").datepicker("option", "altField", "#actualDate");
}
// Options
function altFormat() {
$(".selector").datepicker({ altFormat: "yy-mm-dd" });
// getter
var altFormat: string = $(".selector").datepicker("option", "altFormat");
// setter
var $set: JQuery = $(".selector").datepicker("option", "altFormat", "yy-mm-dd");
}
}
+58 -7
View File
@@ -905,13 +905,6 @@ interface JQuery {
* @param methodName 'isDisabled'
*/
datepicker(methodName: 'isDisabled'): boolean;
/**
* Gets the value currently associated with the specified optionName.
*
* @param methodName 'option'
* @param optionName The name of the option to get.
*/
datepicker(methodName: 'option', optionName: string): any;
/**
* Redraw the date picker, after having made some external modifications.
*
@@ -945,6 +938,64 @@ interface JQuery {
*/
datepicker(methodName: 'widget'): JQuery;
/**
* Get the altField option, after initialization
*
* @param methodName 'option'
* @param optionName 'altField'
*/
datepicker(methodName: 'option', optionName: 'altField'): any;
/**
* Set the altField option, after initialization
*
* @param methodName 'option'
* @param optionName 'altField'
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: string): JQuery;
/**
* Set the altField option, after initialization
*
* @param methodName 'option'
* @param optionName 'altField'
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: JQuery): JQuery;
/**
* Set the altField option, after initialization
*
* @param methodName 'option'
* @param optionName 'altField'
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: Element): JQuery;
/**
* Get the altFormat option, after initialization
*
* @param methodName 'option'
* @param optionName 'altFormat'
*/
datepicker(methodName: 'option', optionName: 'altFormat'): string;
/**
* Set the altFormat option, after initialization
*
* @param methodName 'option'
* @param optionName 'altFormat'
* @param altFormatValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altFormat', altFormatValue: string): JQuery;
/**
* Gets the value currently associated with the specified optionName.
*
* @param methodName 'option'
* @param optionName The name of the option to get.
*/
datepicker(methodName: 'option', optionName: string): any;
datepicker(methodName: 'option', optionName: string, ...otherParams: any[]): any; // Used for getting and setting options
datepicker(methodName: string, ...otherParams: any[]): any;
/**