Chromium Code Reviews| 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> |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 paper-icon-button { | 25 paper-icon-button { |
| 26 height: 32px; | 26 height: 32px; |
| 27 margin: 6px; | 27 margin: 6px; |
| 28 min-width: 32px; | 28 min-width: 32px; |
| 29 padding: 6px; | 29 padding: 6px; |
| 30 width: 32px; | 30 width: 32px; |
| 31 } | 31 } |
| 32 | 32 |
| 33 #icon { | 33 #icon { |
| 34 --paper-icon-button-ink-color: white; | 34 --paper-icon-button-ink-color: white; |
| 35 transition: margin 150ms, opacity 200ms; | 35 transition: margin 150ms, opacity 200ms; |
|
tsergeant
2016/08/23 23:51:32
I even already had the right transition property s
| |
| 36 } | 36 } |
| 37 | 37 |
| 38 #prompt { | 38 #prompt { |
| 39 opacity: 0; | 39 opacity: 0; |
| 40 } | 40 } |
| 41 | 41 |
| 42 paper-spinner-lite { | 42 paper-spinner-lite { |
| 43 --paper-spinner-color: white; | 43 --paper-spinner-color: white; |
| 44 height: 20px; | 44 height: 20px; |
| 45 margin: 0 6px; | 45 margin: 0 6px; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 | 100 |
| 101 /* Search open. */ | 101 /* Search open. */ |
| 102 :host([showing-search][spinner-active]) #icon { | 102 :host([showing-search][spinner-active]) #icon { |
| 103 opacity: 0; | 103 opacity: 0; |
| 104 } | 104 } |
| 105 | 105 |
| 106 :host([narrow][showing-search]) { | 106 :host([narrow][showing-search]) { |
| 107 width: 100%; | 107 width: 100%; |
| 108 } | 108 } |
| 109 | 109 |
| 110 /* | 110 :host-context([dir=ltr]):host([narrow][showing-search]) #icon, |
| 111 * Margin needs to be animated to prevent jumping around during | 111 :host-context([dir=ltr]):host([narrow][showing-search]) |
|
Dan Beam
2016/08/29 20:53:04
wait, why are these dir=ltr?
tsergeant
2016/08/29 22:51:41
aww beans, that was just me forgetting to change t
| |
| 112 * opening/closing. -webkit-margin-start is not animatable, so we have to | 112 paper-spinner-lite { |
| 113 * use regular margin-left/right instead. | 113 -webkit-margin-start: 18px; |
| 114 */ | |
| 115 :host-context([dir=ltr]):host([narrow][showing-search]) #icon { | |
| 116 margin-left: 18px; | |
| 117 } | |
| 118 | |
| 119 :host-context([dir=rtl]):host([narrow][showing-search]) #icon { | |
| 120 margin-right: 18px; | |
| 121 } | 114 } |
| 122 </style> | 115 </style> |
| 123 <paper-spinner-lite | 116 <paper-spinner-lite |
| 124 active="[[isSpinnerShown_(spinnerActive, showingSearch)]]"> | 117 active="[[isSpinnerShown_(spinnerActive, showingSearch)]]"> |
| 125 </paper-spinner-lite> | 118 </paper-spinner-lite> |
| 126 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" | 119 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" |
| 127 tabindex$="[[computeIconTabIndex_(narrow)]]"> | 120 tabindex$="[[computeIconTabIndex_(narrow)]]"> |
| 128 </paper-icon-button> | 121 </paper-icon-button> |
| 129 <paper-input-container id="searchTerm" on-search="onSearchTermSearch" | 122 <paper-input-container id="searchTerm" on-search="onSearchTermSearch" |
| 130 on-keydown="onSearchTermKeydown" no-label-float> | 123 on-keydown="onSearchTermKeydown" no-label-float> |
| 131 <label id="prompt" for="searchInput">[[label]]</label> | 124 <label id="prompt" for="searchInput">[[label]]</label> |
| 132 <input is="iron-input" id="searchInput" type="search" | 125 <input is="iron-input" id="searchInput" type="search" |
| 133 on-blur="onInputBlur_" incremental></input> | 126 on-blur="onInputBlur_" incremental></input> |
| 134 </paper-input-container> | 127 </paper-input-container> |
| 135 <paper-icon-button icon="cr:cancel" id="clearSearch" | 128 <paper-icon-button icon="cr:cancel" id="clearSearch" |
| 136 title="[[clearLabel]]" hidden$="[[!hasSearchText_]]" | 129 title="[[clearLabel]]" hidden$="[[!hasSearchText_]]" |
| 137 on-tap="hideSearch_"> | 130 on-tap="hideSearch_"> |
| 138 </paper-icon-button> | 131 </paper-icon-button> |
| 139 </template> | 132 </template> |
| 140 <script src="cr_toolbar_search_field.js"></script> | 133 <script src="cr_toolbar_search_field.js"></script> |
| 141 </dom-module> | 134 </dom-module> |
| OLD | NEW |