Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_searc h_field_behavior.html"> | |
| 2 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | |
| 3 <link rel="import" href="chrome://resources/html/polymer.html"> | |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.h tml"> | |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> | |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input -container.html"> | |
| 7 | |
| 8 <dom-module id="cr-toolbar"> | |
| 9 <template> | |
| 10 <style> | |
| 11 :host { | |
| 12 color: #fff; | |
| 13 display: flex; | |
| 14 height: 56px; | |
| 15 } | |
| 16 | |
| 17 [hidden] { | |
| 18 display: none !important; | |
| 19 } | |
| 20 | |
| 21 paper-icon-button { | |
| 22 height: 32px; | |
| 23 margin: 6px; | |
| 24 padding: 6px; | |
| 25 width: 32px; | |
| 26 } | |
| 27 | |
| 28 h1 { | |
| 29 @apply(--layout-flex); | |
| 30 -webkit-padding-start: 24px; | |
| 31 font-size: 123%; | |
| 32 font-weight: 400; | |
| 33 } | |
| 34 | |
| 35 #left-content { | |
| 36 align-items: center; | |
| 37 display: flex; | |
| 38 width: var(--side-bar-width, 0); | |
| 39 } | |
| 40 | |
| 41 #centered-content { | |
| 42 -webkit-padding-end: 12px; | |
| 43 display: flex; | |
| 44 flex: 1 1 0; | |
| 45 justify-content: center; | |
| 46 } | |
| 47 | |
| 48 #search-field { | |
| 49 align-items: center; | |
| 50 display: flex; | |
| 51 height: 40px; | |
| 52 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), | |
| 53 width 150ms cubic-bezier(0.4, 0, 0.2, 1); | |
| 54 } | |
| 55 | |
| 56 #search-icon { | |
| 57 --paper-icon-button-ink-color: white; | |
| 58 } | |
| 59 | |
| 60 #search-prompt { | |
| 61 display: none; | |
| 62 overflow: hidden; | |
| 63 white-space: nowrap; | |
| 64 } | |
| 65 | |
| 66 #search-container { | |
| 67 --paper-input-container-input-color: white; | |
| 68 --paper-input-container-underline: { | |
| 69 display: none; | |
| 70 }; | |
| 71 --paper-input-container-underline-focus: { | |
| 72 display: none; | |
| 73 }; | |
| 74 -webkit-padding-start: 2px; | |
| 75 flex: 1; | |
| 76 } | |
| 77 | |
| 78 input[type='search']::-webkit-search-decoration, | |
| 79 input[type='search']::-webkit-search-cancel-button, | |
| 80 input[type='search']::-webkit-search-results-button { | |
| 81 -webkit-appearance: none; | |
| 82 } | |
| 83 | |
| 84 /** Thin layout, no search open. */ | |
| 85 @media(max-width: 900px) { | |
| 86 #centered-content { | |
| 87 justify-content: flex-end; | |
| 88 } | |
| 89 | |
| 90 #search-field { | |
| 91 width: 44px; | |
| 92 } | |
| 93 } | |
| 94 | |
| 95 /** Wide layout, no search open. */ | |
| 96 @media(min-width: 901px) { | |
| 97 :host(:not([showing-search_])) #search-field { | |
| 98 -webkit-padding-end: 0; | |
| 99 background: rgba(0, 0, 0, 0.22); | |
| 100 border-radius: 2px; | |
| 101 cursor: text; | |
| 102 width: 580px; | |
| 103 } | |
| 104 | |
| 105 :host(:not([showing-search_])) #search-icon, | |
| 106 :host(:not([showing-search_])) #search-prompt { | |
| 107 display: inline; | |
| 108 opacity: 0.6; | |
| 109 } | |
| 110 } | |
| 111 | |
| 112 /* Any layout, search open. */ | |
| 113 :host([showing-search_]) #search-field { | |
| 114 width: 100%; | |
| 115 } | |
| 116 | |
| 117 /* Thin layout, search open. */ | |
| 118 @media(max-width: 900px) { | |
| 119 :host([showing-search_]) #left-content { | |
| 120 display: none; | |
| 121 } | |
| 122 | |
| 123 :host([showing-search_]) #search-icon { | |
| 124 margin-left: 18px; | |
| 125 } | |
| 126 } | |
| 127 </style> | |
| 128 <div id="left-content"> | |
| 129 <h1>[[pageName]]</h1> | |
| 130 </div> | |
| 131 | |
| 132 <div id="centered-content"> | |
| 133 <div id="search-field" on-click="showSearch_"> | |
|
dpapad
2016/05/18 23:39:13
Should we be using on-tap instead of on-click, whi
tsergeant
2016/05/19 07:11:55
Done.
| |
| 134 <paper-icon-button id="search-icon" icon="cr:search" | |
| 135 title="[[searchPrompt]]"> | |
| 136 </paper-icon-button> | |
| 137 <span id="search-prompt">[[searchPrompt]]</span> | |
| 138 <paper-input-container id="search-container" | |
| 139 on-search="onSearchTermSearch_" on-keydown="onSearchTermKeydown_" | |
| 140 hidden$="[[!showingSearch_]]" no-label-float> | |
| 141 <input is="iron-input" id="search-input" type="search" | |
| 142 on-blur="onInputBlur_" incremental></input> | |
| 143 </paper-input-container> | |
| 144 <paper-icon-button icon="cr:cancel" id="clear-search" | |
| 145 on-click="toggleShowingSearch_" title="[[clearLabel]]" | |
| 146 hidden$="[[!hasSearchText_]]"> | |
| 147 </paper-icon-button> | |
| 148 </div> | |
| 149 </div> | |
| 150 </template> | |
| 151 <script src="cr_toolbar.js"></script> | |
| 152 </dom-module> | |
| OLD | NEW |