| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 @license | |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
| 7 Code distributed by Google as part of the polymer project is also | |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
| 9 --><html><head><link rel="import" href="../../polymer/polymer.html"> | |
| 10 <link rel="import" href="../../iron-flex-layout/iron-flex-layout.html"> | |
| 11 <link rel="import" href="../../iron-resizable-behavior/iron-resizable-behavior.h
tml"> | |
| 12 | |
| 13 <!-- | |
| 14 app-header-layout is a wrapper element that positions an app-header and other co
ntent. This | |
| 15 element uses the document scroll by default, but it can also define its own scro
lling region. | |
| 16 | |
| 17 Using the document scroll: | |
| 18 | |
| 19 ```html | |
| 20 <app-header-layout> | |
| 21 <app-header fixed condenses effects="waterfall"> | |
| 22 <app-toolbar> | |
| 23 <div title>App name</div> | |
| 24 </app-toolbar> | |
| 25 </app-header> | |
| 26 <div> | |
| 27 main content | |
| 28 </div> | |
| 29 </app-header-layout> | |
| 30 ``` | |
| 31 | |
| 32 Using an own scrolling region: | |
| 33 | |
| 34 ```html | |
| 35 <app-header-layout has-scrolling-region style="width: 300px; height: 400px;"> | |
| 36 <app-header fixed condenses effects="waterfall"> | |
| 37 <app-toolbar> | |
| 38 <div title>App name</div> | |
| 39 </app-toolbar> | |
| 40 </app-header> | |
| 41 <div> | |
| 42 main content | |
| 43 </div> | |
| 44 </app-header-layout> | |
| 45 ``` | |
| 46 | |
| 47 @group App Elements | |
| 48 @element app-header-layout | |
| 49 @demo app-header-layout/demo/simple.html Simple Demo | |
| 50 @demo app-header-layout/demo/scrolling-region.html Scrolling Region | |
| 51 @demo app-header-layout/demo/music.html Music Demo | |
| 52 --> | |
| 53 | |
| 54 </head><body><dom-module id="app-header-layout"> | |
| 55 <template> | |
| 56 <style> | |
| 57 :host { | |
| 58 display: block; | |
| 59 | |
| 60 /** | |
| 61 * Force app-header-layout to have its own stacking context so that its
parent can | |
| 62 * control the stacking of it relative to other elements (e.g. app-drawe
r-layout). | |
| 63 * This could be done using `isolation: isolate`, but that's not well su
pported | |
| 64 * across browsers. | |
| 65 */ | |
| 66 position: relative; | |
| 67 z-index: 0; | |
| 68 } | |
| 69 | |
| 70 :host([has-scrolling-region]) { | |
| 71 height: 100%; | |
| 72 } | |
| 73 | |
| 74 :host > ::content > app-header { | |
| 75 @apply(--layout-fixed-top); | |
| 76 | |
| 77 z-index: 1; | |
| 78 } | |
| 79 | |
| 80 :host([has-scrolling-region]) > ::content > app-header { | |
| 81 position: absolute; | |
| 82 } | |
| 83 | |
| 84 #contentContainer { | |
| 85 /* Create a stacking context here so that all children appear below the
header. */ | |
| 86 position: relative; | |
| 87 z-index: 0; | |
| 88 } | |
| 89 | |
| 90 :host([has-scrolling-region]) > #contentContainer { | |
| 91 @apply(--layout-fit); | |
| 92 | |
| 93 overflow-y: auto; | |
| 94 -webkit-overflow-scrolling: touch; | |
| 95 } | |
| 96 </style> | |
| 97 | |
| 98 <content id="header" select="app-header"></content> | |
| 99 | |
| 100 <div id="contentContainer"> | |
| 101 <content></content> | |
| 102 </div> | |
| 103 | |
| 104 </template> | |
| 105 | |
| 106 </dom-module> | |
| 107 <script src="app-header-layout-extracted.js"></script></body></html> | |
| OLD | NEW |