Skip to main content

Search and Top Navigation

#2295 closed enhancement (fixed)

Opened February 07, 2008 04:09PM UTC

Closed May 26, 2008 07:00PM UTC

UI plugins should expose defaults

Reported by: scottgonzalez Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.5b4
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 (10)

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 scottgonzalez 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 scottgonzalez comment:3

Fixed for dialogs in [4695].

Changed March 16, 2008 05:27PM UTC by scottgonzalez comment:4

Already done in accordion.

Changed March 16, 2008 05:38PM UTC by scottgonzalez 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 May 24, 2008 03:39AM UTC by comment:8

milestone: 1.2.3

Milestone 1.2.3 deleted

Changed May 24, 2008 04:21PM UTC by paul comment:9

milestone: → 1.5
version: 1.2.21.5b4

Changed May 26, 2008 07:00PM UTC by paul comment:10

resolution: → fixed
status: newclosed