Skip to content

Deal with disable option on create #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 22, 2015
Merged

Deal with disable option on create #1

merged 10 commits into from
Sep 22, 2015

Conversation

jzaefferer
Copy link

Building on top of jquerygh-1599, this fixes missing or redundant handling of the disabled option on create. The only missing widget is tabs. From my comment on the original PR:

Tabs is not working correctly, for example it ends up with the ui-tabs-disabled class when only setting specific tabs, like disabled: [1, 2]. Due to the array variant I haven't yet figured out what to do here.

@jzaefferer
Copy link
Author

This wasn't really supposed to be a PR on your fork :/

@@ -175,16 +175,22 @@ return $.widget( "ui.accordion", {
}
}

if ( key === "disabled" ) {
this._setOptionDisabled( value );
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already happens in the call to ._super() above.

@scottgonzalez
Copy link
Owner

For tabs, you should be able to just rename ._setupDisabled(). You can drop the conditional in ._setOptions() as well.

@jzaefferer
Copy link
Author

Updated. Removed all the redundant calls in setOption. Updated tooltip to use _setOptionDisabled.

Updated tabs, renaming to _setupDisabled to _setOptionDisabled. It still calls _setOptionDisabled in _refresh, which is also called on create. I added an explicit _toggleClass call to only add "ui-tabs-disabled" when all tabs are disabled.

@scottgonzalez scottgonzalez merged commit 80f85e0 into scottgonzalez:disabled-setter Sep 22, 2015
@jzaefferer jzaefferer deleted the disabled-setter2 branch September 30, 2015 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants