OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. |
| 5 --> |
| 6 <import src="/sky/framework/sky-drawer.sky" /> |
| 7 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> |
| 8 <import src="/sky/framework/sky-scrollable.sky" /> |
| 9 |
| 10 <sky-element name="example-scaffold"> |
| 11 <template> |
| 12 <style> |
| 13 :host { |
| 14 display: flex; |
| 15 flex-direction: column; |
| 16 height: -webkit-fill-available; |
| 17 } |
| 18 sky-drawer { |
| 19 position: absolute; |
| 20 z-index: 1; |
| 21 } |
| 22 sky-toolbar { |
| 23 display: flex; |
| 24 align-items: center; |
| 25 background-color: #526E9C; |
| 26 color: white; |
| 27 height: 56px; |
| 28 } |
| 29 #menu { |
| 30 display: flex; |
| 31 justify-content: center; |
| 32 align-items: center; |
| 33 width: 24px; |
| 34 height: 24px; |
| 35 padding: 7px; |
| 36 margin: 0 8px; |
| 37 background-color: papayawhip; |
| 38 color: black; |
| 39 } |
| 40 #title { |
| 41 flex: 1; |
| 42 margin: 0 8px; |
| 43 } |
| 44 sky-scrollable { |
| 45 flex: 1; |
| 46 background-color: green; |
| 47 } |
| 48 </style> |
| 49 <sky-drawer id="drawer"> |
| 50 <content select=".menu"/> |
| 51 </sky-drawer> |
| 52 <sky-toolbar> |
| 53 <div id="menu" on-click="handleMenuClick"/> |
| 54 <content id="title" select=".title"/> |
| 55 </sky-toolbar> |
| 56 <sky-scrollable> |
| 57 <content /> |
| 58 </sky-scrollable> |
| 59 </template> |
| 60 <script> |
| 61 module.exports = class extends SkyElement { |
| 62 created() { |
| 63 this.toolbar_ = null; |
| 64 } |
| 65 |
| 66 shadowRootReady() { |
| 67 this.toolbar_ = this.shadowRoot.getElementById('drawer'); |
| 68 } |
| 69 |
| 70 handleMenuClick() { |
| 71 this.toolbar_.toggle(); |
| 72 } |
| 73 }.register(); |
| 74 </script> |
| 75 </sky-element> |
OLD | NEW |