Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: ui/file_manager/file_manager/foreground/js/file_manager_commands.js

Issue 895633005: Optimize the ripple effect on the navigation bar in Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/file_manager_commands.js
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
index 7f035d219d3e22983a6b55f4c69e72b0b43dc095..662c39f9f30550af197d0416e2185bdd2a254216 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
@@ -276,8 +276,11 @@ CommandHandler.prototype.updateAvailability = function() {
* @private
*/
CommandHandler.prototype.shouldIgnoreEvents_ = function() {
- // Do not handle commands, when a dialog is shown.
- if (this.fileManager_.document.querySelector('.cr-dialog-container.shown'))
+ // Do not handle commands, when a dialog is shown. Do not use querySelector
+ // as it's much slower, and this method is executed often.
+ var dialogs = this.fileManager_.document.getElementsByClassName(
+ 'cr-dialog-container');
+ if (dialogs.length !== 0 && dialogs[0].classList.contains('shown'))
return true;
return false; // Do not ignore.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698