summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/file_manager/js/image_editor/image_editor.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/resources/file_manager/js/image_editor/image_editor.js b/chrome/browser/resources/file_manager/js/image_editor/image_editor.js
index c9de33d..6512053 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/image_editor.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/image_editor.js
@@ -332,7 +332,14 @@ ImageEditor.prototype.enterMode = function(mode, event) {
}
this.leaveModeGently();
+ // The above call could have caused a commit which might have initiated
+ // an asynchronous command execution. Wait for it to complete, then proceed
+ // with the mode set up.
+ this.commandQueue_.requestCurrentImage(
+ this.setUpMode_.bind(this, mode, event));
+};
+ImageEditor.prototype.setUpMode_ = function(mode, event) {
this.currentTool_ = event.target;
ImageUtil.setAttribute(this.currentTool_, 'pressed', true);