Opened 15 years ago
Closed 13 years ago
#2295 closed enhancement (invalid)
UI plugins should expose defaults
Reported by: | scottgonzalez | Owned by: | paul |
---|---|---|---|
Priority: | major | Milestone: | 1.2.3 |
Component: | ui | Version: | 1.2.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
UI plugins should expose their default settings so they can be changed by the user.
Change History (8)
comment:1 Changed 15 years ago by
comment:2 follow-up: 5 Changed 15 years ago by
In the resizable constructor, the following code is used to set the default settings:
//Prepare the passed options this.options = $.extend({ preventDefault: true, transparent: false, minWidth: 10, minHeight: 10, aspectRatio: false, disableSelection: true, preserveCursor: true, animate: false, duration: 'fast', easing: 'swing', autohide: false }, options);
If that was changed to:
//Prepare the passed options this.options = $.extend($.ui.resizable.defaults, options);
And:
$.ui.resizable.defaults = { preventDefault: true, transparent: false, minWidth: 10, minHeight: 10, aspectRatio: false, disableSelection: true, preserveCursor: true, animate: false, duration: 'fast', easing: 'swing', autohide: false };
Then users could change the default behavior by changing the defaults. For instance, if I wanted all of my resizable elements to resize slowly, I could do:
$.ui.resizable.defaults.duration = 'slow';
comment:5 Changed 15 years ago by
That should have been:
//Prepare the passed options this.options = $.extend({}, $.ui.resizable.defaults, options);
comment:8 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Moved to UI bug tracker, I think.
Note: See
TracTickets for help on using
tickets.
What exactly do you mean by exposing the default settings?