Chromium Code Reviews| Index: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.js |
| diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.js b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..abcc0d525e9ad04d442880dbeb15fa2a0daa3d5a |
| --- /dev/null |
| +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.js |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +Polymer({ |
| + is: 'cr-toolbar', |
| + |
| + behaviors: [CrSearchFieldBehavior], |
| + |
| + properties: { |
| + // Name to display in the toolbar, in titlecase. |
| + pageName: String, |
| + // Prompt text to display in the search field. |
| + searchPrompt: String, |
| + // Tooltip to display on the clear search button. |
| + clearLabel: String, |
| + }, |
| + |
| + onInputBlur_: function(e) { |
| + if (!this.hasSearchText_) |
| + this.showingSearch_ = false; |
| + }, |
| + |
| + showSearch_: function(e) { |
| + if (e.target != this.$['clear-search']) |
|
dpapad
2016/05/18 23:39:13
Nit (optional): Change id to clearSearch, such tha
tsergeant
2016/05/19 07:11:55
I was sticking with the style used in cr-search-fi
|
| + this.showingSearch_ = true; |
| + }, |
| + |
| + computeLowerPageName_: function(name) { |
|
dpapad
2016/05/18 23:39:14
Type annotations for parameter and return value mi
tsergeant
2016/05/19 07:11:55
oops, that function is dead code. So, uh
Done.
|
| + return name.toLowerCase(); |
| + } |
| +}); |