| OLD | NEW |
| (Empty) | |
| 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"> |
| 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"> |
| 5 <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/icons.html"> |
| 7 |
| 8 <dom-module id="cr-toolbar-search-field"> |
| 9 <template> |
| 10 <style> |
| 11 :host { |
| 12 align-items: center; |
| 13 display: flex; |
| 14 height: 40px; |
| 15 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), |
| 16 width 150ms cubic-bezier(0.4, 0, 0.2, 1); |
| 17 width: 44px; |
| 18 } |
| 19 |
| 20 [hidden] { |
| 21 display: none !important; |
| 22 } |
| 23 |
| 24 paper-icon-button { |
| 25 height: 32px; |
| 26 margin: 6px; |
| 27 padding: 6px; |
| 28 width: 32px; |
| 29 } |
| 30 |
| 31 #icon { |
| 32 --paper-icon-button-ink-color: white; |
| 33 } |
| 34 |
| 35 #prompt { |
| 36 visibility: hidden; |
| 37 } |
| 38 |
| 39 paper-input-container { |
| 40 --paper-input-container-input-color: white; |
| 41 --paper-input-container-underline: { |
| 42 display: none; |
| 43 }; |
| 44 --paper-input-container-underline-focus: { |
| 45 display: none; |
| 46 }; |
| 47 --paper-input-container-label: { |
| 48 color: inherit; |
| 49 font-size: inherit; |
| 50 }; |
| 51 -webkit-padding-start: 2px; |
| 52 flex: 1; |
| 53 } |
| 54 |
| 55 input[type='search']::-webkit-search-decoration, |
| 56 input[type='search']::-webkit-search-cancel-button, |
| 57 input[type='search']::-webkit-search-results-button { |
| 58 -webkit-appearance: none; |
| 59 } |
| 60 |
| 61 /** Wide layout, no search open. */ |
| 62 :host(:not([narrow]):not([showing-search])) { |
| 63 -webkit-padding-end: 0; |
| 64 background: rgba(0, 0, 0, 0.22); |
| 65 border-radius: 2px; |
| 66 cursor: text; |
| 67 width: 580px; |
| 68 } |
| 69 |
| 70 :host(:not([narrow]):not([showing-search])) #icon, |
| 71 :host(:not([narrow]):not([showing-search])) #prompt { |
| 72 opacity: 0.6; |
| 73 visibility: visible; |
| 74 } |
| 75 |
| 76 /* Any layout, search open. */ |
| 77 :host([showing-search]) { |
| 78 width: 100%; |
| 79 } |
| 80 |
| 81 :host([narrow][showing-search]) #icon { |
| 82 -webkit-margin-start: 18px; |
| 83 } |
| 84 </style> |
| 85 <paper-icon-button id="icon" icon="cr:search" |
| 86 title="[[label]]"> |
| 87 </paper-icon-button> |
| 88 <paper-input-container on-search="onSearchTermSearch_" |
| 89 on-keydown="onSearchTermKeydown_" no-label-float> |
| 90 <label id="prompt" for="searchInput">[[label]]</label> |
| 91 <input is="iron-input" id="searchInput" type="search" |
| 92 on-blur="onInputBlur_" incremental></input> |
| 93 </paper-input-container> |
| 94 <paper-icon-button icon="cr:cancel" id="clearSearch" |
| 95 title="[[clearLabel]]" hidden$="[[!hasSearchText]]" |
| 96 on-tap="hideSearch_"> |
| 97 </paper-icon-button> |
| 98 </template> |
| 99 <script src="cr_toolbar_search_field.js"></script> |
| 100 </dom-module> |
| OLD | NEW |