OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Polymer({ | 5 Polymer({ |
6 is: 'cr-toolbar', | 6 is: 'cr-toolbar', |
7 | 7 |
8 properties: { | 8 properties: { |
9 // Name to display in the toolbar, in titlecase. | 9 // Name to display in the toolbar, in titlecase. |
10 pageName: String, | 10 pageName: String, |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Controls whether the menu button is shown at the start of the menu. | 29 // Controls whether the menu button is shown at the start of the menu. |
30 showMenu: {type: Boolean, value: false}, | 30 showMenu: {type: Boolean, value: false}, |
31 | 31 |
32 // Whether to show menu promo tooltip. | 32 // Whether to show menu promo tooltip. |
33 showMenuPromo: { | 33 showMenuPromo: { |
34 type: Boolean, | 34 type: Boolean, |
35 value: false, | 35 value: false, |
36 }, | 36 }, |
37 | 37 |
| 38 // True when the toolbar is displaying in narrow mode. |
| 39 narrow: { |
| 40 type: Boolean, |
| 41 reflectToAttribute: true, |
| 42 readonly: true, |
| 43 notify: true, |
| 44 }, |
| 45 |
38 closeMenuPromo: String, | 46 closeMenuPromo: String, |
39 | 47 |
40 /** @private */ | 48 /** @private */ |
41 narrow_: {type: Boolean, reflectToAttribute: true}, | |
42 | |
43 /** @private */ | |
44 showingSearch_: { | 49 showingSearch_: { |
45 type: Boolean, | 50 type: Boolean, |
46 reflectToAttribute: true, | 51 reflectToAttribute: true, |
47 }, | 52 }, |
48 }, | 53 }, |
49 | 54 |
50 observers: [ | 55 observers: [ |
51 'possiblyShowMenuPromo_(showMenu, showMenuPromo, showingSearch_)', | 56 'possiblyShowMenuPromo_(showMenu, showMenuPromo, showingSearch_)', |
52 ], | 57 ], |
53 | 58 |
(...skipping 30 matching lines...) Expand all Loading... |
84 | 89 |
85 /** | 90 /** |
86 * @param {string} title | 91 * @param {string} title |
87 * @param {boolean} showMenuPromo | 92 * @param {boolean} showMenuPromo |
88 * @return {string} The title if the menu promo isn't showing, else "". | 93 * @return {string} The title if the menu promo isn't showing, else "". |
89 */ | 94 */ |
90 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { | 95 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { |
91 return showMenuPromo ? '' : title; | 96 return showMenuPromo ? '' : title; |
92 }, | 97 }, |
93 }); | 98 }); |
OLD | NEW |