From 9480db26457fbc39cfa6b50398eeb0dfb2da68cc Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 16 Apr 2014 13:59:31 +0100 Subject: [PATCH] jQueryUI: started adding option overloads --- jqueryui/jqueryui-tests.ts | 12 ++++++++++ jqueryui/jqueryui.d.ts | 49 ++++++++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 213156fef9..ae8038b056 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -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"); + } + } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index e87f096956..a44c24bc4b 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -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; /**