Bug Tracker

Opened 8 years ago

Closed 6 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 8 years ago by paul

What exactly do you mean by exposing the default settings?

comment:2 follow-up: Changed 8 years ago by scott.gonzal

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:3 Changed 8 years ago by scott.gonzal

Fixed for dialogs in [4695].

comment:4 Changed 8 years ago by scott.gonzal

Already done in accordion.

comment:5 in reply to: ↑ 2 Changed 8 years ago by scott.gonzal

That should have been:

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

comment:6 Changed 8 years ago by klaus

Fixed for tabs in r5033

comment:7 Changed 8 years ago by paul

fixed for draggables

comment:8 Changed 6 years ago by dmethvin

  • Resolution set to invalid
  • Status changed from new to closed

Moved to UI bug tracker, I think.

Note: See TracTickets for help on using tickets.