OLD | NEW |
1 <link rel="import" href="chrome://resources/html/polymer.html"> | 1 <link rel="import" href="chrome://resources/html/polymer.html"> |
2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.h
tml"> | 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.h
tml"> |
3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> |
4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input
-container.html"> | 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input
-container.html"> |
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spi
nner-lite.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spi
nner-lite.html"> |
6 <link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_searc
h_field_behavior.html"> | 6 <link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_searc
h_field_behavior.html"> |
7 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | 7 <link rel="import" href="chrome://resources/cr_elements/icons.html"> |
8 | 8 |
9 <dom-module id="cr-toolbar-search-field"> | 9 <dom-module id="cr-toolbar-search-field"> |
10 <template> | 10 <template> |
11 <style> | 11 <style> |
12 :host { | 12 :host { |
13 align-items: center; | 13 align-items: center; |
14 display: flex; | 14 display: flex; |
15 height: 40px; | 15 height: 40px; |
16 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), | 16 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), |
17 width 150ms cubic-bezier(0.4, 0, 0.2, 1); | 17 width 150ms cubic-bezier(0.4, 0, 0.2, 1), |
| 18 left 150ms cubic-bezier(0.4, 0, 0.2, 1); |
18 width: 44px; | 19 width: 44px; |
19 } | 20 } |
20 | 21 |
21 [hidden] { | 22 [hidden] { |
22 display: none !important; | 23 display: none !important; |
23 } | 24 } |
24 | 25 |
25 paper-icon-button { | 26 paper-icon-button { |
26 height: 32px; | 27 height: 32px; |
27 margin: 6px; | 28 margin: 6px; |
| 29 min-width: 32px; |
28 padding: 6px; | 30 padding: 6px; |
29 width: 32px; | 31 width: 32px; |
30 } | 32 } |
31 | 33 |
32 #icon { | 34 #icon { |
33 --paper-icon-button-ink-color: white; | 35 --paper-icon-button-ink-color: white; |
34 transition: opacity 150ms; | 36 transition: opacity 150ms; |
35 } | 37 } |
36 | 38 |
37 #prompt { | 39 #prompt { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 opacity: 0.6; | 85 opacity: 0.6; |
84 } | 86 } |
85 | 87 |
86 :host(:not([narrow]):not([showing-search])) #prompt { | 88 :host(:not([narrow]):not([showing-search])) #prompt { |
87 visibility: visible; | 89 visibility: visible; |
88 } | 90 } |
89 | 91 |
90 /* Any layout, search open. */ | 92 /* Any layout, search open. */ |
91 :host([showing-search]) { | 93 :host([showing-search]) { |
92 width: 100%; | 94 width: 100%; |
| 95 left: 0; |
93 } | 96 } |
94 | 97 |
95 :host([showing-search][spinner-active]) #icon { | 98 :host([showing-search][spinner-active]) #icon { |
96 opacity: 0; | 99 opacity: 0; |
97 } | 100 } |
98 | |
99 :host([narrow][showing-search]) #icon { | |
100 -webkit-margin-start: 18px; | |
101 } | |
102 </style> | 101 </style> |
103 <paper-spinner-lite | 102 <paper-spinner-lite |
104 active="[[isSpinnerShown_(spinnerActive, showingSearch)]]"> | 103 active="[[isSpinnerShown_(spinnerActive, showingSearch)]]"> |
105 </paper-spinner-lite> | 104 </paper-spinner-lite> |
106 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" | 105 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" |
107 tabindex$="[[computeIconTabIndex_(narrow)]]"> | 106 tabindex$="[[computeIconTabIndex_(narrow)]]"> |
108 </paper-icon-button> | 107 </paper-icon-button> |
109 <paper-input-container on-search="onSearchTermSearch" | 108 <paper-input-container on-search="onSearchTermSearch" |
110 on-keydown="onSearchTermKeydown" on-keypress="onSearchTermKeypress_" | 109 on-keydown="onSearchTermKeydown" on-keypress="onSearchTermKeypress_" |
111 no-label-float> | 110 no-label-float> |
112 <label id="prompt" for="searchInput">[[label]]</label> | 111 <label id="prompt" for="searchInput">[[label]]</label> |
113 <input is="iron-input" id="searchInput" type="search" | 112 <input is="iron-input" id="searchInput" type="search" |
114 on-blur="onInputBlur_" incremental></input> | 113 on-blur="onInputBlur_" incremental></input> |
115 </paper-input-container> | 114 </paper-input-container> |
116 <paper-icon-button icon="cr:cancel" id="clearSearch" | 115 <paper-icon-button icon="cr:cancel" id="clearSearch" |
117 title="[[clearLabel]]" hidden$="[[!hasSearchText]]" | 116 title="[[clearLabel]]" hidden$="[[!hasSearchText]]" |
118 on-tap="hideSearch_"> | 117 on-tap="hideSearch_"> |
119 </paper-icon-button> | 118 </paper-icon-button> |
120 </template> | 119 </template> |
121 <script src="cr_toolbar_search_field.js"></script> | 120 <script src="cr_toolbar_search_field.js"></script> |
122 </dom-module> | 121 </dom-module> |
OLD | NEW |