This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Don't show overwrite animation on click#6883
Merged
redmunds merged 2 commits intoadobe:masterfrom Mar 10, 2014
Merged
Conversation
src/editor/EditorStatusBar.js
Outdated
Contributor
There was a problem hiding this comment.
I don't like the idea of manipulating the click event handler back and forth like that. What do you think about this solution?
function _updateOverwriteLabel(event, editor, newstate, doNotAnimate) {
if ($statusOverwrite.text() === (newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT)) {
// label already up-to-date
return;
}
$statusOverwrite.text(newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT);
if (!doNotAnimate) {
AnimationUtils.animateUsingClass($statusOverwrite[0], "flash");
}
}
function _updateEditorOverwriteMode(event) {
var editor = EditorManager.getActiveEditor(),
newstate = !editor._codeMirror.state.overwrite;
// update label with no transition
_updateOverwriteLabel(event, editor, newstate, true);
editor.toggleOverwrite(newstate);
}
The click handler first changes the label with no animation, so when the "overwriteToggle" event is received, the label has already been changed, so it is not changed with animation.
Contributor
|
@WebsiteDeveloper Done with review. |
Contributor
Author
|
@redmunds i added the changes you proposed. |
Contributor
|
Looks good. Merging. |
redmunds
added a commit
that referenced
this pull request
Mar 10, 2014
Don't show overwrite animation on click
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Part of #6862
@redmunds