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

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

Issue 1170913006: Add material design toggle ripple element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix format. Created 5 years, 6 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
Index: ui/file_manager/file_manager/foreground/js/gear_menu_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/gear_menu_controller.js b/ui/file_manager/file_manager/foreground/js/gear_menu_controller.js
index 48e9ae2e7a1f1a4626b32188f16163b9ec352fc5..fc1bbbf65c1cbe222e4ac9e2daf8222b776f87c1 100644
--- a/ui/file_manager/file_manager/foreground/js/gear_menu_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/gear_menu_controller.js
@@ -4,6 +4,7 @@
/**
* @param {!cr.ui.MenuButton} gearButton
+ * @param {!FilesToggleRipple} toggleRipple
* @param {!GearMenu} gearMenu
* @param {!DirectoryModel} directoryModel
* @param {!CommandHandler} commandHandler
@@ -11,7 +12,14 @@
* @struct
*/
function GearMenuController(
- gearButton, gearMenu, directoryModel, commandHandler) {
+ gearButton, toggleRipple, gearMenu, directoryModel, commandHandler) {
+ /**
+ * @type {!FilesToggleRipple}
+ * @const
+ * @private
+ */
+ this.toggleRipple_ = toggleRipple;
+
/**
* @type {!GearMenu}
* @const
@@ -34,6 +42,7 @@ function GearMenuController(
this.commandHandler_ = commandHandler;
gearButton.addEventListener('menushow', this.onShowGearMenu_.bind(this));
+ gearButton.addEventListener('menuhide', this.onHideGearMenu_.bind(this));
directoryModel.addEventListener(
'directory-changed', this.onDirectoryChanged_.bind(this));
chrome.fileManagerPrivate.onPreferencesChanged.addListener(
@@ -45,6 +54,7 @@ function GearMenuController(
* @private
*/
GearMenuController.prototype.onShowGearMenu_ = function() {
+ this.toggleRipple_.activated = true;
this.refreshRemainingSpace_(false); /* Without loading caption. */
// Update view of drive-related settings.
@@ -52,6 +62,13 @@ GearMenuController.prototype.onShowGearMenu_ = function() {
};
/**
+ * @private
+ */
+GearMenuController.prototype.onHideGearMenu_ = function() {
+ this.toggleRipple_.activated = false;
+};
+
+/**
* @param {Event} event
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698