From beb5e1df56f729f25085920951abaf3e0b4c41a8 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 16 Apr 2014 17:06:57 +0100 Subject: [PATCH] jQuery UI: continued on option getters / setters --- jqueryui/jqueryui-tests.ts | 20 +++++++++++++++++++- jqueryui/jqueryui.d.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index cc0fb4f72..987b48c4f 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1165,7 +1165,6 @@ function test_datepicker() { var $set: JQuery = $(".selector").datepicker("option", "altField", "#actualDate"); } - // Options function altFormat() { $(".selector").datepicker({ altFormat: "yy-mm-dd" }); @@ -1176,6 +1175,25 @@ function test_datepicker() { var $set: JQuery = $(".selector").datepicker("option", "altFormat", "yy-mm-dd"); } + function appendText() { + $(".selector").datepicker({ appendText: "(yyyy-mm-dd)" }); + + // getter + var appendText: string = $(".selector").datepicker("option", "appendText"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "appendText", "(yyyy-mm-dd)"); + } + + function autoSize() { + $(".selector").datepicker({ autoSize: true }); + + // getter + var autoSize: boolean = $(".selector").datepicker("option", "autoSize"); + + // setter + var $set: JQuery = $(".selector").datepicker("option", "autoSize", true); + } } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 4bd2e433f..e2b6d1fb8 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -986,6 +986,38 @@ interface JQuery { */ datepicker(methodName: 'option', optionName: 'altFormat', altFormatValue: string): JQuery; + /** + * Get the appendText option, after initialization + * + * @param methodName 'option' + * @param optionName 'appendText' + */ + datepicker(methodName: 'option', optionName: 'appendText'): string; + /** + * Set the appendText option, after initialization + * + * @param methodName 'option' + * @param optionName 'appendText' + * @param appendTextValue The text to display after each date field, e.g., to show the required format. + */ + datepicker(methodName: 'option', optionName: 'appendText', appendTextValue: string): JQuery; + + /** + * Get the autoSize option, after initialization + * + * @param methodName 'option' + * @param optionName 'autoSize' + */ + datepicker(methodName: 'option', optionName: 'autoSize'): boolean; + /** + * Set the autoSize option, after initialization + * + * @param methodName 'option' + * @param optionName 'autoSize' + * @param autoSizeValue Set to true to automatically resize the input field to accommodate dates in the current dateFormat. + */ + datepicker(methodName: 'option', optionName: 'autoSize', autoSizeValue: string): JQuery; + /** * Gets the value currently associated with the specified optionName. *