]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker: Remove support for setting options via custom attributes.
authorScott González <scott.gonzalez@gmail.com>
Tue, 27 Nov 2012 03:49:47 +0000 (22:49 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 27 Nov 2012 03:50:36 +0000 (22:50 -0500)
ui/jquery.ui.datepicker.js

index 823934e05c3770767bd64724ab0913b1a170ec3f..949ebb93a3d53db25644477d07c7f38eacbe740f 100644 (file)
@@ -139,20 +139,7 @@ $.extend(Datepicker.prototype, {
         * @param  settings  object - the new settings to use for this date picker instance (anonymous)
         */
        _attachDatepicker: function(target, settings) {
-               // check for settings on the control itself - in namespace 'date:'
-               var attrName, attrValue, nodeName, inline, inst,
-                       inlineSettings = null;
-               for (attrName in this._defaults) {
-                       attrValue = target.getAttribute('date:' + attrName);
-                       if (attrValue) {
-                               inlineSettings = inlineSettings || {};
-                               try {
-                                       inlineSettings[attrName] = eval(attrValue);
-                               } catch (err) {
-                                       inlineSettings[attrName] = attrValue;
-                               }
-                       }
-               }
+               var nodeName, inline, inst;
                nodeName = target.nodeName.toLowerCase();
                inline = (nodeName === 'div' || nodeName === 'span');
                if (!target.id) {
@@ -160,7 +147,7 @@ $.extend(Datepicker.prototype, {
                        target.id = 'dp' + this.uuid;
                }
                inst = this._newInst($(target), inline);
-               inst.settings = $.extend({}, settings || {}, inlineSettings || {});
+               inst.settings = $.extend({}, settings || {});
                if (nodeName === 'input') {
                        this._connectDatepicker(target, inst);
                } else if (inline) {