Skip to content

Rename class ui-disabled to ui-state-disabled and implement .widget() method #5390

Closed
gabrielschulhof opened this Issue Dec 20, 2012 · 4 comments

3 participants

@gabrielschulhof

The widget factory's implementation of _setOption( "disabled", newValue ) assigns two classes to the element returned by a widget implementation's widget() function: namespace-widgetname-disabled and ui-state-disabled.

So, we should do two things to take advantage of this functionality:

  1. Implement .widget() for all our widgets. The default implementation in the widget factory returns this.element from .widget(), which means the above-mentioned classes will be assigned to this.element. This is not very useful for us, because we often wrap this.element in what is really the widget's outermost element, so we should override that method for those widgets that do that.

  2. Rename our ui-disabled class to ui-state-disabled, so as to avoid duplicating the code from the widget factory. That is, our _setOption( "disabled", newValue ) implementations should not have to add/remove the class ui-disabled, when the widget factory already does that for us.

@jaspermdegroot
jQuery Foundation member

@gabrielschulhof

Are there still widgets where this needs to implemented? If so, I suggest we close this ticket and create new ones for each of those widgets and refer to this ticket.

@gabrielschulhof

I think we're good for 1.4.0, but we should keep this open for 1.5.0 so we don't forget to remove all references to ui-disabled, even from the CSS.

@gabrielschulhof

In fact, the widget factory no longer adds ui-state-disabled, but only ui--disabled, so we need to rethink that as well.

@arschmitz
jQuery Foundation member

Closing this we have addressed this everywhere

@arschmitz arschmitz closed this Jun 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.