| 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 --cr-toolbar-field-width: 580px; |
| 10 color: #fff; | 11 color: #fff; |
| 11 display: flex; | 12 display: flex; |
| 12 height: 56px; | 13 height: 56px; |
| 13 } | 14 } |
| 14 | 15 |
| 15 h1 { | 16 h1 { |
| 16 @apply(--layout-flex); | 17 @apply(--layout-flex); |
| 17 font-size: 123%; | 18 font-size: 123%; |
| 18 font-weight: 400; | 19 font-weight: 400; |
| 20 text-overflow: ellipsis; |
| 21 overflow: hidden; |
| 22 white-space: nowrap; |
| 19 } | 23 } |
| 20 | 24 |
| 21 #leftContent { | 25 #leftContent { |
| 22 align-items: center; | 26 align-items: center; |
| 23 display: flex; | 27 display: flex; |
| 28 position: absolute; |
| 29 transition: opacity 100ms; |
| 24 } | 30 } |
| 25 | 31 |
| 26 #leftContent paper-icon-button { | 32 #leftContent paper-icon-button { |
| 27 -webkit-margin-end: 6px; | 33 -webkit-margin-end: 6px; |
| 28 -webkit-margin-start: 18px; | 34 -webkit-margin-start: 18px; |
| 29 height: 32px; | 35 height: 32px; |
| 30 margin-bottom: 6px; | 36 margin-bottom: 6px; |
| 31 margin-top: 6px; | 37 margin-top: 6px; |
| 32 min-width: 32px; | 38 min-width: 32px; |
| 33 padding: 6px; | 39 padding: 6px; |
| 34 width: 32px; | 40 width: 32px; |
| 35 } | 41 } |
| 36 | 42 |
| 37 #centeredContent { | 43 #centeredContent { |
| 38 -webkit-padding-end: 12px; | 44 -webkit-padding-end: 12px; |
| 39 display: flex; | 45 display: flex; |
| 40 flex: 1 1 0; | 46 flex: 1 1 0; |
| 41 justify-content: center; | 47 justify-content: center; |
| 42 } | 48 } |
| 43 | 49 |
| 50 :host(:not([narrow_])) #leftContent { |
| 51 max-width: calc((100% - var(--cr-toolbar-field-width) - 18px) / 2); |
| 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 |