| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
| 6 Code distributed by Google as part of the polymer project is also | |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
| 8 --><!-- | |
| 9 `core-scaffold` provides general application layout, introducing a | |
| 10 responsive scaffold containing a header, toolbar, menu, title and | |
| 11 areas for application content. | |
| 12 | |
| 13 Example: | |
| 14 | |
| 15 <core-scaffold> | |
| 16 <core-header-panel navigation flex mode="seamed"> | |
| 17 <core-toolbar>Application</core-toolbar> | |
| 18 <core-menu theme="core-light-theme"> | |
| 19 <core-item icon="settings" label="item1"></core-item> | |
| 20 <core-item icon="settings" label="item2"></core-item> | |
| 21 </core-menu> | |
| 22 </core-header-panel> | |
| 23 <div tool>Title</div> | |
| 24 <div>Main content goes here...</div> | |
| 25 </core-scaffold> | |
| 26 | |
| 27 Use `mode` to control the header and scrolling behavior of `core-header-panel` | |
| 28 and `responsiveWidth` to change the layout of the scaffold. Use 'disableSwipe' | |
| 29 to disable swipe-to-open on toolbar. | |
| 30 | |
| 31 Use `rightDrawer` to move position of folding toolbar to the right instead of | |
| 32 left (default). This will also position content to the left of the menu button | |
| 33 instead of the right. You can use `flex` within your `tool` content to push the
menu | |
| 34 button to the far right: | |
| 35 | |
| 36 <core-scaffold rightDrawer> | |
| 37 <div tool flex >Title</div> | |
| 38 </core-scaffold> | |
| 39 | |
| 40 You may also add `middle` or `bottom` classes to your `tool` content when using
tall | |
| 41 modes to adjust vertical content positioning in the core-toolbar (e.g. when usin
g | |
| 42 mode="waterfall-tall"): | |
| 43 | |
| 44 <core-scaffold rightDrawer mode="waterfall-tall"> | |
| 45 <div tool flex >Title</div> | |
| 46 <div tool horizontal layout flex center-justified class="middle">Title-mid
dle</div> | |
| 47 <div tool horizontal layout flex end-justified class="bottom">Title-bottom
</div> | |
| 48 </core-scaffold> | |
| 49 | |
| 50 To have the content fit to the main area, use `fit` attribute. | |
| 51 | |
| 52 <core-scaffold> | |
| 53 <core-header-panel navigation flex mode="seamed"> | |
| 54 .... | |
| 55 </core-header-panel> | |
| 56 <div tool>Title</div> | |
| 57 <div fit>Content fits to the main area</div> | |
| 58 </core-scaffold> | |
| 59 | |
| 60 @group Polymer Core Elements | |
| 61 @element core-scaffold | |
| 62 @homepage github.io | |
| 63 --><html><head><link rel="import" href="../core-toolbar/core-toolbar.html"> | |
| 64 <link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
| 65 <link rel="import" href="../core-header-panel/core-header-panel.html"> | |
| 66 <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| 67 | |
| 68 </head><body><polymer-element name="core-scaffold" assetpath=""> | |
| 69 <template> | |
| 70 | |
| 71 <style> | |
| 72 | |
| 73 :host { | |
| 74 display: block; | |
| 75 } | |
| 76 | |
| 77 [drawer] { | |
| 78 background-color: #fff; | |
| 79 box-shadow: 1px 0 1px rgba(0, 0, 0, 0.1); | |
| 80 } | |
| 81 | |
| 82 [main] { | |
| 83 height: 100%; | |
| 84 background-color: #eee; | |
| 85 } | |
| 86 | |
| 87 core-toolbar { | |
| 88 background-color: #526E9C; | |
| 89 color: #fff; | |
| 90 } | |
| 91 | |
| 92 #drawerPanel:not([narrow]) #menuButton { | |
| 93 display: none; | |
| 94 } | |
| 95 | |
| 96 </style> | |
| 97 | |
| 98 <core-drawer-panel id="drawerPanel" narrow="{{narrow}}" drawerwidth="{{drawerW
idth}}" rightdrawer="{{rightDrawer}}" responsivewidth="{{responsiveWidth}}" disa
bleswipe="{{disableSwipe}}"> | |
| 99 | |
| 100 <div vertical="" layout="" drawer=""> | |
| 101 | |
| 102 <content select="[navigation], nav"></content> | |
| 103 | |
| 104 </div> | |
| 105 | |
| 106 <core-header-panel id="headerPanel" main="" mode="{{mode}}"> | |
| 107 | |
| 108 <core-toolbar> | |
| 109 <template if="{{!rightDrawer}}"> | |
| 110 <core-icon-button id="menuButton" icon="menu" on-tap="{{togglePanel}}"
></core-icon-button> | |
| 111 </template> | |
| 112 <content select="[tool]"></content> | |
| 113 <template if="{{rightDrawer}}"> | |
| 114 <core-icon-button id="menuButton" icon="menu" on-tap="{{togglePanel}}"
></core-icon-button> | |
| 115 </template> | |
| 116 </core-toolbar> | |
| 117 | |
| 118 <content select="*"></content> | |
| 119 | |
| 120 </core-header-panel> | |
| 121 | |
| 122 </core-drawer-panel> | |
| 123 | |
| 124 </template> | |
| 125 | |
| 126 </polymer-element> | |
| 127 <script charset="utf-8" src="core-scaffold-extracted.js"></script></body></html> | |
| OLD | NEW |