jQueryUI: started adding option overloads

This commit is contained in:
John Reilly
2014-04-16 13:59:31 +01:00
parent 739e9fd044
commit 9480db2645
2 changed files with 54 additions and 7 deletions

View File

@@ -1153,6 +1153,18 @@ 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 = $(".selector").datepicker("option", "altField");
// setter
$(".selector").datepicker("option", "altField", "#actualDate");
}
}

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,48 @@ 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): 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: JQuery): 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: Element): any;
/**
* 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;
/**