Bug Tracker

Ticket #2295 (closed enhancement: invalid)

Opened 6 years ago

Last modified 4 years ago

UI plugins should expose defaults

Reported by: scott.gonzalez Owned by: paul
Priority: major Milestone: 1.2.3
Component: ui Version: 1.2.2
Keywords: Cc:
Blocking: Blocked by:

Description

UI plugins should expose their default settings so they can be changed by the user.

Change History

comment:1 Changed 6 years ago by paul

What exactly do you mean by exposing the default settings?

comment:2 follow-up: ↓ 5 Changed 6 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 6 years ago by scott.gonzal

Fixed for dialogs in [4695].

comment:4 Changed 6 years ago by scott.gonzal

Already done in accordion.

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

That should have been:

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

comment:6 Changed 6 years ago by klaus

Fixed for tabs in r5033

comment:7 Changed 6 years ago by paul

fixed for draggables

comment:8 Changed 4 years ago by dmethvin

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

Moved to UI bug tracker, I think.

Note: See TracTickets for help on using tickets.