Commit c5f8df51 authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

FilesApp selection menu delay remove toolbar-menu class to avoid flicker

Remove the 'toolbar-menu' class when menu closing animation is
complete to avoid flicker.

Bug: 862926
Change-Id: I8b52b86297a5f629d00b8cf43bce3c537a6ef323
Reviewed-on: https://chromium-review.googlesource.com/c/1347957Reviewed-by: default avatarStuart Langley <slangley@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610324}
parent 67b3b7aa
......@@ -28,18 +28,11 @@ function SelectionMenuController(selectionMenuButton, menu) {
selectionMenuButton.addEventListener('menuhide', this.onHideMenu_.bind(this));
}
/**
* Class name to indicate if the menu was opened by the toolbar button or not.
* @type {string}
* @const
*/
SelectionMenuController.TOOLBAR_MENU = 'toolbar-menu';
/**
* @private
*/
SelectionMenuController.prototype.onShowMenu_ = function() {
this.menu_.classList.toggle(SelectionMenuController.TOOLBAR_MENU, true);
this.menu_.classList.toggle('toolbar-menu', true);
this.toggleRipple_.activated = true;
};
......@@ -47,6 +40,7 @@ SelectionMenuController.prototype.onShowMenu_ = function() {
* @private
*/
SelectionMenuController.prototype.onHideMenu_ = function() {
this.menu_.classList.toggle(SelectionMenuController.TOOLBAR_MENU, false);
// Do not remove 'toolbar-menu' yet, it will be removed at the end of
// FilesMenuItem.setMenuAsAnimating_ to avoid flicker. See crbug.com/862926.
this.toggleRipple_.activated = false;
};
......@@ -107,6 +107,10 @@ cr.define('cr.ui', function() {
if (menuItem instanceof cr.ui.FilesMenuItem)
menuItem.setAnimating_(value);
}
if (!value) {
menu.classList.remove('toolbar-menu');
}
},
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment