aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.datepicker.js
diff options
context:
space:
mode:
authorkborchers <k_borchers@yahoo.com>2011-05-20 13:44:14 -0500
committerkborchers <k_borchers@yahoo.com>2011-05-20 13:44:14 -0500
commitab365be03d2672784b6475cb05baaad0a9076e7d (patch)
tree13c147851a0de7c8659369de84cf05593765c327 /ui/jquery.ui.datepicker.js
parent237bbc5aedb6d0ce935325309bff1795ebad45c5 (diff)
downloadjquery-ui-ab365be03d2672784b6475cb05baaad0a9076e7d.tar.gz
jquery-ui-ab365be03d2672784b6475cb05baaad0a9076e7d.zip
Datepicker: Added checks for the disabled option. Fixed #5665 - Datepicker: Disabled parameter doesn't work
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r--ui/jquery.ui.datepicker.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 4c73bdfd8..ae3a9ac32 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -105,7 +105,8 @@ function Datepicker() {
altFormat: '', // The date format to use for the alternate field
constrainInput: true, // The input is constrained by the current date format
showButtonPanel: false, // True to show button panel, false to not show it
- autoSize: false // True to size the input for the date format, false to leave as is
+ autoSize: false, // True to size the input for the date format, false to leave as is
+ disabled: false // The initial disabled state
};
$.extend(this._defaults, this.regional['']);
this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));
@@ -194,6 +195,10 @@ $.extend(Datepicker.prototype, {
});
this._autoSize(inst);
$.data(target, PROP_NAME, inst);
+ //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
},
/* Make attachments based on settings. */
@@ -273,6 +278,10 @@ $.extend(Datepicker.prototype, {
this._setDate(inst, this._getDefaultDate(inst), true);
this._updateDatepicker(inst);
this._updateAlternate(inst);
+ //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
inst.dpDiv.show();
},