| 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-media-query/iron-m
edia-query.html"> | 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-media-query/iron-m
edia-query.html"> |
| 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/cr_elements/cr_toolbar/cr_toolbar_se
arch_field.html"> | 4 <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar_se
arch_field.html"> |
| 5 | 5 |
| 6 <dom-module id="cr-toolbar"> | 6 <dom-module id="cr-toolbar"> |
| 7 <template> | 7 <template> |
| 8 <style> | 8 <style> |
| 9 :host { | 9 :host { |
| 10 color: #fff; | 10 color: #fff; |
| 11 display: flex; | 11 display: flex; |
| 12 height: 56px; | 12 height: 56px; |
| 13 } | 13 } |
| 14 | 14 |
| 15 h1 { | 15 h1 { |
| 16 @apply(--layout-flex); | 16 @apply(--layout-flex); |
| 17 font-size: 123%; | 17 font-size: 123%; |
| 18 font-weight: 400; | 18 font-weight: 400; |
| 19 } | 19 } |
| 20 | 20 |
| 21 #leftContent { | 21 #leftContent { |
| 22 align-items: center; | 22 align-items: center; |
| 23 display: flex; | 23 display: flex; |
| 24 position: absolute; |
| 25 transition: opacity 100ms; |
| 24 } | 26 } |
| 25 | 27 |
| 26 #leftContent paper-icon-button { | 28 #leftContent paper-icon-button { |
| 27 -webkit-margin-end: 6px; | 29 -webkit-margin-end: 6px; |
| 28 -webkit-margin-start: 18px; | 30 -webkit-margin-start: 18px; |
| 29 height: 32px; | 31 height: 32px; |
| 30 margin-bottom: 6px; | 32 margin-bottom: 6px; |
| 31 margin-top: 6px; | 33 margin-top: 6px; |
| 32 min-width: 32px; | 34 min-width: 32px; |
| 33 padding: 6px; | 35 padding: 6px; |
| 34 width: 32px; | 36 width: 32px; |
| 35 } | 37 } |
| 36 | 38 |
| 37 #centeredContent { | 39 #centeredContent { |
| 38 -webkit-padding-end: 12px; | 40 -webkit-padding-end: 12px; |
| 39 display: flex; | 41 display: flex; |
| 40 flex: 1 1 0; | 42 flex: 1 1 0; |
| 41 justify-content: center; | 43 justify-content: center; |
| 42 } | 44 } |
| 43 | 45 |
| 46 :host(:not([narrow_])) #centeredContent { |
| 47 /* |
| 48 * Create a 180px area on the left which the search field will never |
| 49 * overlap (it will go off-center to avoid it). |
| 50 */ |
| 51 margin: 0 180px; |
| 52 } |
| 53 |
| 44 :host([narrow_]) #centeredContent { | 54 :host([narrow_]) #centeredContent { |
| 45 justify-content: flex-end; | 55 justify-content: flex-end; |
| 46 } | 56 } |
| 47 | 57 |
| 48 :host([narrow_][showing-search_]) #leftContent { | 58 :host([narrow_][showing-search_]) #leftContent { |
| 49 display: none; | 59 opacity: 0; |
| 50 } | 60 } |
| 51 </style> | 61 </style> |
| 52 <div id="leftContent"> | 62 <div id="leftContent"> |
| 53 <paper-icon-button icon="cr:menu" on-tap="onMenuTap_"> | 63 <paper-icon-button icon="cr:menu" on-tap="onMenuTap_"> |
| 54 </paper-icon-button> | 64 </paper-icon-button> |
| 55 <h1>[[pageName]]</h1> | 65 <h1>[[pageName]]</h1> |
| 56 </div> | 66 </div> |
| 57 | 67 |
| 58 <div id="centeredContent"> | 68 <div id="centeredContent"> |
| 59 <cr-toolbar-search-field id="search" narrow="[[narrow_]]" | 69 <cr-toolbar-search-field id="search" narrow="[[narrow_]]" |
| 60 label="[[searchPrompt]]" clear-label="[[clearLabel]]" | 70 label="[[searchPrompt]]" clear-label="[[clearLabel]]" |
| 61 spinner-active="[[spinnerActive]]" | 71 spinner-active="[[spinnerActive]]" |
| 62 showing-search="{{showingSearch_}}"> | 72 showing-search="{{showingSearch_}}"> |
| 63 </cr-toolbar-search-field> | 73 </cr-toolbar-search-field> |
| 64 <iron-media-query query="(max-width: 900px)" query-matches="{{narrow_}}"> | 74 <iron-media-query query="(max-width: 900px)" query-matches="{{narrow_}}"> |
| 65 </iron-media-query> | 75 </iron-media-query> |
| 66 </div> | 76 </div> |
| 67 </template> | 77 </template> |
| 68 <script src="cr_toolbar.js"></script> | 78 <script src="cr_toolbar.js"></script> |
| 69 </dom-module> | 79 </dom-module> |
| OLD | NEW |