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

Side by Side Diff: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js

Issue 1963503002: MD WebUI: Add shared cr-toolbar element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style review comments Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // TODO(tsergeant): Add tests for cr-toolbar-search-field.
6 Polymer({
7 is: 'cr-toolbar-search-field',
8
9 behaviors: [CrSearchFieldBehavior],
10
11 properties: {
12 narrow: {
13 type: Boolean,
14 reflectToAttribute: true,
15 },
16
17 // Prompt text to display in the search field.
18 label: String,
19
20 // Tooltip to display on the clear search button.
21 clearLabel: String,
22 },
23
24 listeners: {
25 'tap': 'showSearch_',
26 },
27
28 /** @private */
29 onInputBlur_: function() {
30 if (!this.hasSearchText)
31 this.showingSearch = false;
32 },
33
34 /**
35 * @param {Event} e
36 * @private
37 */
38 showSearch_: function(e) {
39 if (e.target != this.$.clearSearch)
40 this.showingSearch = true;
41 },
42
43 /**
44 * @param {Event} e
45 * @private
46 */
47 hideSearch_: function(e) {
48 this.showingSearch = false;
49 e.stopPropagation();
50 }
51 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html ('k') | ui/webui/resources/cr_elements_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698