Chromium Code Reviews| 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 display: none; | |
| 37 overflow: hidden; | |
| 38 white-space: nowrap; | |
| 39 } | |
| 40 | |
| 41 paper-input-container { | |
| 42 --paper-input-container-input-color: white; | |
| 43 --paper-input-container-underline: { | |
| 44 display: none; | |
| 45 }; | |
| 46 --paper-input-container-underline-focus: { | |
| 47 display: none; | |
| 48 }; | |
| 49 -webkit-padding-start: 2px; | |
| 50 flex: 1; | |
| 51 } | |
| 52 | |
| 53 input[type='search']::-webkit-search-decoration, | |
| 54 input[type='search']::-webkit-search-cancel-button, | |
| 55 input[type='search']::-webkit-search-results-button { | |
| 56 -webkit-appearance: none; | |
| 57 } | |
| 58 | |
| 59 /** Wide layout, no search open. */ | |
| 60 :host(:not([narrow]):not([showing-search])) { | |
| 61 -webkit-padding-end: 0; | |
| 62 background: rgba(0, 0, 0, 0.22); | |
| 63 border-radius: 2px; | |
| 64 cursor: text; | |
| 65 width: 580px; | |
| 66 } | |
| 67 | |
| 68 :host(:not([narrow]):not([showing-search])) #icon, | |
| 69 :host(:not([narrow]):not([showing-search])) #prompt { | |
| 70 display: inline; | |
| 71 opacity: 0.6; | |
| 72 } | |
| 73 | |
| 74 /* Any layout, search open. */ | |
| 75 :host([showing-search]) { | |
| 76 width: 100%; | |
| 77 } | |
| 78 | |
| 79 :host([narrow][showing-search]) #icon { | |
| 80 margin-left: 18px; | |
| 81 } | |
| 82 </style> | |
| 83 <paper-icon-button id="icon" icon="cr:search" | |
| 84 title="[[label]]"> | |
| 85 </paper-icon-button> | |
| 86 <span id="prompt">[[label]]</span> | |
|
dpapad
2016/05/25 01:20:10
What is this used for? Can't we use the native "pl
tsergeant
2016/05/25 07:01:30
The original reason I avoided placeholder was beca
| |
| 87 <paper-input-container | |
| 88 on-search="onSearchTermSearch_" on-keydown="onSearchTermKeydown_" | |
| 89 hidden$="[[!showingSearch]]" no-label-float> | |
| 90 <input is="iron-input" id="searchInput" type="search" | |
| 91 on-blur="onInputBlur_" incremental></input> | |
| 92 </paper-input-container> | |
| 93 <paper-icon-button icon="cr:cancel" id="clearSearch" | |
| 94 title="[[clearLabel]]" hidden$="[[!hasSearchText_]]"> | |
| 95 </paper-icon-button> | |
| 96 </template> | |
| 97 <script src="cr_toolbar_search_field.js"></script> | |
| 98 </dom-module> | |
| OLD | NEW |