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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/search_box.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/ui/search_box.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/search_box.js b/ui/file_manager/file_manager/foreground/js/ui/search_box.js
index 3131da2022799991c00b83d2c9c486acd8cabd46..171dfcae1cf4910ce4f4dcb5430dbe7da7b30613 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/search_box.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/search_box.js
@@ -5,9 +5,9 @@
/**
* Search box.
*
- * @param {Element} element Root element of the search box.
- * @param {Element} searchButton Search button.
- * @param {Element} noResultMessage Message element for the empty result.
+ * @param {!Element} element Root element of the search box.
+ * @param {!Element} searchButton Search button.
+ * @param {!Element} noResultMessage Message element for the empty result.
* @extends {cr.EventTarget}
* @constructor
*/
@@ -22,19 +22,28 @@ function SearchBox(element, searchButton, noResultMessage) {
/**
* Root element of the search box.
- * @type {Element}
+ * @type {!Element}
*/
this.element = element;
/**
* Search button.
- * @type {Element}
+ * @type {!Element}
*/
this.searchButton = searchButton;
/**
+ * Ripple effect of search button.
+ * @private {!FilesToggleRipple}
+ * @const
+ */
+ this.searchButtonToggleRipple_ =
+ /** @type {!FilesToggleRipple} */ (queryRequiredElement(
+ this.searchButton, 'files-toggle-ripple'));
+
+ /**
* No result message.
- * @type {Element}
+ * @type {!Element}
*/
this.noResultMessage = noResultMessage;
@@ -205,6 +214,7 @@ SearchBox.prototype.onFocus_ = function() {
this.element.classList.toggle('has-cursor', true);
this.autocompleteList.attachToInput(this.inputElement);
this.updateStyles_();
+ this.searchButtonToggleRipple_.activated = true;
};
/**
@@ -215,6 +225,7 @@ SearchBox.prototype.onBlur_ = function() {
this.element.classList.toggle('has-cursor', false);
this.autocompleteList.detach();
this.updateStyles_();
+ this.searchButtonToggleRipple_.activated = false;
};
/**
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js ('k') | ui/file_manager/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698