Skip to content
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

FIX TreeDropdownField doesnt change label on unselect #4272

Merged
merged 1 commit into from Jun 14, 2015

Conversation

dhensby
Copy link
Contributor

@dhensby dhensby commented Jun 11, 2015

This fixes a front-end regression in the CMS where changing a drop down to an unselected value appeared to make no difference:

Before:

After:

@dhensby
Copy link
Contributor Author

dhensby commented Jun 11, 2015

This needs merging into 3 branch too

if(title) {
self.setTitle(title);
self.data('title', title);
}
if(node) tree.jstree('select_node', node);
}
else {
self.setTitle(self.data('empty-title'));
Copy link
Contributor

Choose a reason for hiding this comment

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

self.data('emptyTitle')

https://api.jquery.com/data/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Either will work, if you do camelCase then jQuery will look for the camelCase then the dash-separated names. So it's actually more performant this way

The native JS data API requires camelCase, though.

I can change it, but it's ultimately not going to change the behaviour and be fractionally slower

tractorcow pushed a commit that referenced this pull request Jun 14, 2015
FIX TreeDropdownField doesnt change label on unselect
@tractorcow tractorcow merged commit 6facb1b into silverstripe:3.1 Jun 14, 2015
@dhensby
Copy link
Contributor Author

dhensby commented Jun 14, 2015

thanks

@dhensby dhensby deleted the pulls/tree-dropdown-fix branch June 15, 2015 00:17
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.

None yet

2 participants