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 -webkit-padding-end: 12px; | |
13 align-items: center; | 14 align-items: center; |
14 display: flex; | 15 display: flex; |
15 height: 40px; | 16 height: 40px; |
16 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), | 17 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), |
17 width 150ms cubic-bezier(0.4, 0, 0.2, 1); | 18 width 150ms cubic-bezier(0.4, 0, 0.2, 1), |
19 left 150ms cubic-bezier(0.4, 0, 0.2, 1); | |
18 width: 44px; | 20 width: 44px; |
19 } | 21 } |
20 | 22 |
21 [hidden] { | 23 [hidden] { |
22 display: none !important; | 24 display: none !important; |
23 } | 25 } |
24 | 26 |
25 paper-icon-button { | 27 paper-icon-button { |
26 height: 32px; | 28 height: 32px; |
27 margin: 6px; | 29 margin: 6px; |
30 min-width: 32px; | |
28 padding: 6px; | 31 padding: 6px; |
29 width: 32px; | 32 width: 32px; |
30 } | 33 } |
31 | 34 |
32 #icon { | 35 #icon { |
33 --paper-icon-button-ink-color: white; | 36 --paper-icon-button-ink-color: white; |
34 transition: opacity 150ms; | 37 transition: opacity 150ms; |
35 } | 38 } |
36 | 39 |
37 #prompt { | 40 #prompt { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 :host(:not([narrow]):not([showing-search])) #prompt { | 85 :host(:not([narrow]):not([showing-search])) #prompt { |
83 opacity: 0.6; | 86 opacity: 0.6; |
84 } | 87 } |
85 | 88 |
86 :host(:not([narrow]):not([showing-search])) #prompt { | 89 :host(:not([narrow]):not([showing-search])) #prompt { |
87 visibility: visible; | 90 visibility: visible; |
88 } | 91 } |
89 | 92 |
90 /* Any layout, search open. */ | 93 /* Any layout, search open. */ |
91 :host([showing-search]) { | 94 :host([showing-search]) { |
92 width: 100%; | 95 width: calc(100% - 12px); |
calamity
2016/06/17 03:02:00
Pull 12px into a css var.
tsergeant
2016/06/20 05:05:57
Done.
| |
96 left: 0; | |
93 } | 97 } |
94 | 98 |
95 :host([showing-search][spinner-active]) #icon { | 99 :host([showing-search][spinner-active]) #icon { |
96 opacity: 0; | 100 opacity: 0; |
97 } | 101 } |
98 | |
99 :host([narrow][showing-search]) #icon { | |
100 -webkit-margin-start: 18px; | |
101 } | |
102 </style> | 102 </style> |
103 <paper-spinner-lite | 103 <paper-spinner-lite |
104 active="[[isSpinnerShown_(spinnerActive, showingSearch)]]"> | 104 active="[[isSpinnerShown_(spinnerActive, showingSearch)]]"> |
105 </paper-spinner-lite> | 105 </paper-spinner-lite> |
106 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" | 106 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" |
107 tabindex$="[[computeIconTabIndex_(narrow)]]"> | 107 tabindex$="[[computeIconTabIndex_(narrow)]]"> |
108 </paper-icon-button> | 108 </paper-icon-button> |
109 <paper-input-container on-search="onSearchTermSearch" | 109 <paper-input-container on-search="onSearchTermSearch" |
110 on-keydown="onSearchTermKeydown" on-keypress="onSearchTermKeypress_" | 110 on-keydown="onSearchTermKeydown" on-keypress="onSearchTermKeypress_" |
111 no-label-float> | 111 no-label-float> |
112 <label id="prompt" for="searchInput">[[label]]</label> | 112 <label id="prompt" for="searchInput">[[label]]</label> |
113 <input is="iron-input" id="searchInput" type="search" | 113 <input is="iron-input" id="searchInput" type="search" |
114 on-blur="onInputBlur_" incremental></input> | 114 on-blur="onInputBlur_" incremental></input> |
115 </paper-input-container> | 115 </paper-input-container> |
116 <paper-icon-button icon="cr:cancel" id="clearSearch" | 116 <paper-icon-button icon="cr:cancel" id="clearSearch" |
117 title="[[clearLabel]]" hidden$="[[!hasSearchText]]" | 117 title="[[clearLabel]]" hidden$="[[!hasSearchText]]" |
118 on-tap="hideSearch_"> | 118 on-tap="hideSearch_"> |
119 </paper-icon-button> | 119 </paper-icon-button> |
120 </template> | 120 </template> |
121 <script src="cr_toolbar_search_field.js"></script> | 121 <script src="cr_toolbar_search_field.js"></script> |
122 </dom-module> | 122 </dom-module> |
OLD | NEW |