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" /> | |
8 <import src="/sky/framework/sky-scrollable.sky" /> | |
9 | |
10 <sky-element> | |
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 top: 0; | |
22 left: 0; | |
23 bottom: 0; | |
24 right: 0; | |
25 } | |
26 sky-toolbar { | |
27 display: flex; | |
28 align-items: center; | |
29 background-color: #526E9C; | |
30 color: white; | |
31 height: 56px; | |
32 } | |
33 #menu { | |
34 display: flex; | |
35 justify-content: center; | |
36 align-items: center; | |
37 width: 24px; | |
38 height: 24px; | |
39 padding: 7px; | |
40 margin: 0 8px; | |
41 background-color: papayawhip; | |
42 color: black; | |
43 } | |
44 #title { | |
45 flex: 1; | |
46 margin: 0 8px; | |
47 } | |
48 sky-scrollable { | |
49 flex: 1; | |
50 background-color: green; | |
51 } | |
52 </style> | |
53 <sky-drawer id="drawer"> | |
54 <content select=".menu"/> | |
55 </sky-drawer> | |
56 <sky-toolbar> | |
57 <div id="menu" /> | |
58 <content id="title" select=".title"/> | |
59 </sky-toolbar> | |
60 <sky-scrollable> | |
61 <content /> | |
62 </sky-scrollable> | |
63 </template> | |
64 <script> | |
65 import "dart:sky"; | |
66 | |
67 @Tagname('example-scaffold') | |
68 class ExampleScaffold extends SkyElement { | |
69 Element _drawer; | |
70 | |
71 void shadowRootReady() { | |
72 _drawer = shadowRoot.getElementById('drawer'); | |
73 Element menu = shadowRoot.getElementById('menu'); | |
74 menu.addEventListener('click', _handleMenuClick); | |
75 } | |
76 | |
77 void _handleMenuClick(_) { | |
78 _drawer.toggle(); | |
79 } | |
80 } | |
81 | |
82 _init(script) => register(script, ExampleScaffold); | |
83 </script> | |
84 </sky-element> | |
OLD | NEW |