diff options
author | Keith Wood <kbwood.au@gmail.com> | 2008-08-21 09:16:35 +0000 |
---|---|---|
committer | Keith Wood <kbwood.au@gmail.com> | 2008-08-21 09:16:35 +0000 |
commit | 2fd7f5f035f24b0e3cefae621ecdb3cb4814f2cf (patch) | |
tree | e5f1e7bd0c7c154ed5751f19ee216ff7fc515031 | |
parent | 5a0431afbc0cf2027df466f9e1405d69d5a092cc (diff) | |
download | jquery-ui-2fd7f5f035f24b0e3cefae621ecdb3cb4814f2cf.tar.gz jquery-ui-2fd7f5f035f24b0e3cefae621ecdb3cb4814f2cf.zip |
Fixed 3180 Datepicker automatic ID assignment
-rw-r--r-- | ui/ui.datepicker.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index fee8ed9a8..10a11ba15 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -168,7 +168,7 @@ $.extend(Datepicker.prototype, { var nodeName = target.nodeName.toLowerCase(); var inline = (nodeName == 'div' || nodeName == 'span'); if (!target.id) - target.id = 'dp' + new Date().getTime(); + target.id = 'dp' + ++this.uuid; var inst = this._newInst($(target), inline); inst.settings = $.extend({}, settings || {}, inlineSettings || {}); if (nodeName == 'input') { @@ -262,7 +262,7 @@ $.extend(Datepicker.prototype, { _dialogDatepicker: function(input, dateText, onSelect, settings, pos) { var inst = this._dialogInst; // internal instance if (!inst) { - var id = 'dp' + new Date().getTime(); + var id = 'dp' + ++this.uuid; this._dialogInput = $('<input type="text" id="' + id + '" size="1" style="position: absolute; top: -100px;"/>'); this._dialogInput.keydown(this._doKeyDown); @@ -1679,5 +1679,6 @@ $.fn.datepicker = function(options){ $.datepicker = new Datepicker(); // singleton instance $.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); })(jQuery); |