Index: ui/file_manager/file_manager/foreground/js/sort_menu_controller.js |
diff --git a/ui/file_manager/file_manager/foreground/js/sort_menu_controller.js b/ui/file_manager/file_manager/foreground/js/sort_menu_controller.js |
index 3a7907997b930eb2fc3ab6f8df56b64a60ff4e41..f9123bc5e4bd072b9c25b9f4c3afdc032f09bdd0 100644 |
--- a/ui/file_manager/file_manager/foreground/js/sort_menu_controller.js |
+++ b/ui/file_manager/file_manager/foreground/js/sort_menu_controller.js |
@@ -4,11 +4,15 @@ |
/** |
* @param {!cr.ui.MenuButton} sortButton |
+ * @param {!FilesToggleRipple} toggleRipple |
* @param {!FileListModel} fileListModel |
* @constructor |
* @struct |
*/ |
-function SortMenuController(sortButton, fileListModel) { |
+function SortMenuController(sortButton, toggleRipple, fileListModel) { |
+ /** @private {!FilesToggleRipple} */ |
+ this.toggleRipple_ = toggleRipple; |
+ |
/** @private {!FileListModel} */ |
this.fileListModel_ = fileListModel; |
@@ -26,6 +30,7 @@ function SortMenuController(sortButton, fileListModel) { |
sortButton.menu, '#sort-menu-sort-by-date'); |
sortButton.addEventListener('menushow', this.updateCheckmark_.bind(this)); |
+ sortButton.addEventListener('menuhide', this.onHideSortMenu_.bind(this)); |
}; |
/** |
@@ -33,6 +38,7 @@ function SortMenuController(sortButton, fileListModel) { |
* @private |
*/ |
SortMenuController.prototype.updateCheckmark_ = function() { |
+ this.toggleRipple_.activated = true; |
var sortField = this.fileListModel_.sortStatus.field; |
this.setCheckStatus_(this.sortByNameButton_, sortField === 'name'); |
@@ -43,6 +49,14 @@ SortMenuController.prototype.updateCheckmark_ = function() { |
}; |
/** |
+ * Handle hide event of sort menu button. |
+ * @private |
+ */ |
+SortMenuController.prototype.onHideSortMenu_ = function() { |
+ this.toggleRipple_.activated = false; |
+}; |
+ |
+/** |
* Set attribute 'checked' for the menu item. |
* @param {!HTMLElement} menuItem |
* @param {boolean} checked True if the item should have 'checked' attribute. |