Skip to main content

Bug Tracker

Side navigation

#2295 closed enhancement (invalid)

Opened February 07, 2008 04:09PM UTC

Closed July 28, 2010 02:45AM UTC

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.

Attachments (0)
Change History (8)

Changed February 08, 2008 04:09PM UTC by paul comment:1

What exactly do you mean by exposing the default settings?

Changed February 08, 2008 07:03PM UTC by scott.gonzal comment:2

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';

Changed February 08, 2008 10:14PM UTC by scott.gonzal comment:3

Fixed for dialogs in [4695].

Changed March 16, 2008 05:27PM UTC by scott.gonzal comment:4

Already done in accordion.

Changed March 16, 2008 05:38PM UTC by scott.gonzal comment:5

That should have been:

    //Prepare the passed options
    this.options = $.extend({}, $.ui.resizable.defaults, options);

Changed March 17, 2008 12:13AM UTC by klaus comment:6

Fixed for tabs in r5033

Changed May 03, 2008 08:33AM UTC by paul comment:7

fixed for draggables

Changed July 28, 2010 02:45AM UTC by dmethvin comment:8

resolution: → invalid
status: newclosed

Moved to UI bug tracker, I think.