Replace the unicode toggle with Redmine's sprite icon - #45
Merged
Conversation
Fixes xmera-circle#3 The trigger used the unicode characters U+25B6 / U+25BC, which render differently across browsers and platforms and do not follow the theme. Redmine 6 ships an icon sprite; 'angle-right' is the shape the core uses for the same purpose. The icon is now rendered once in the partial and the state is expressed purely by the existing css class: `.trigger.opened svg` is rotated by 90 degrees. JavaScript no longer rewrites the element's content, so the class is the single source of truth. That also fixes a latent inconsistency: when a level was collapsed, the nested triggers below it had their glyph replaced but kept the `opened` class. They now get `closed` like the element the user actually clicked, so a subsequent click on them behaves as expected instead of collapsing something that already looks collapsed. `slides.js` shrinks by four lines and no longer knows about presentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3
The trigger used the unicode characters U+25B6 / U+25BC, which render differently across browsers and platforms and do not follow the theme. Redmine 6 ships an icon sprite; 'angle-right' is the shape the core uses for the same purpose.
The icon is now rendered once in the partial and the state is expressed purely by the existing css class:
.trigger.opened svgis rotated by 90 degrees. JavaScript no longer rewrites the element's content, so the class is the single source of truth.That also fixes a latent inconsistency: when a level was collapsed, the nested triggers below it had their glyph replaced but kept the
openedclass. They now getclosedlike the element the user actually clicked, so a subsequent click on them behaves as expected instead of collapsing something that already looks collapsed.slides.jsshrinks by four lines and no longer knows about presentation.Thank you very much for your contribution! We highly appreciate that.
Please compare your branch with the develop branch of this repository.