This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
polymer-ui-scaffold.html
148 lines (144 loc) · 4.22 KB
/
polymer-ui-scaffold.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!--
/**
* Polymer UI Elements
*
* @module Polymer UI Elements
*/
/**
* @class polymer-ui-scaffold
*/
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../polymer-grid-layout/polymer-grid-layout.html">
<link rel="import" href="../polymer-ui-toolbar/polymer-ui-toolbar.html">
<link rel="import" href="../polymer-ui-icon-button/polymer-ui-icon-button.html">
<polymer-element name="polymer-ui-scaffold" attributes="menuActive hideMenuButton">
<template>
<link rel="stylesheet" href="polymer-ui-scaffold.css">
<polymer-grid-layout id="grid"></polymer-grid-layout>
<section class="animate" offscreen="basement">
<content select="[navigation]"></content>
</section>
<polymer-ui-toolbar class="animate">
<polymer-ui-icon-button icon="menu" hidden?="{{hideMenuButton}}" on-tap="{{menuActionTap}}" active="{{menuActive}}"></polymer-ui-icon-button>
<content select="[tool]"></content>
</polymer-ui-toolbar>
<section class="animate">
<content select="*"></content>
</section>
</template>
<script>
(function() {
Polymer('polymer-ui-scaffold', {
menuActive: false,
hideMenuButton: false,
layouts: {
main:[
[2, 2],
[3, 3],
[3, 3]
],
menu: [
[1, 2, 2],
[1, 3, 3],
[1, 3, 3]
]
},
ready: function() {
this.$.grid.layout = this.layouts.main;
},
menuActionTap: function() {
this.menuActive = !this.menuActive;
Platform.flush();
},
menuActiveChanged: function() {
this.$.grid.layout = this.layouts[this.menuActive ? 'menu' : 'main'];
}
});
})();
</script>
</polymer-element>
<polymer-element name="polymer-ui-scaffold2" attributes="">
<template>
<link rel="stylesheet" href="polymer-ui-scaffold.css">
<polymer-grid-layout id="grid"></polymer-grid-layout>
<section>
<content select="[navigation]"></content>
</section>
<polymer-ui-toolbar class="animate">
<content select="[tool]"></content>
</polymer-ui-toolbar>
<section class="animate">
<content select="[main]"></content>
</section>
</template>
<script>
(function() {
Polymer('polymer-ui-scaffold2', {
menuActive: false,
layouts: {
main:[
[3, 3, 1],
[3, 3, 1],
[2, 2, 1]
]
},
ready: function() {
this.$.grid.layout = this.layouts.main;
},
});
})();
</script>
</polymer-element>
<polymer-element name="polymer-ui-scaffold3" attributes="menuActive hideMenuButton">
<template>
<link rel="stylesheet" href="polymer-ui-scaffold.css">
<polymer-grid-layout id="grid"></polymer-grid-layout>
<section class="animate" style="z-index: 10;" offscreen="left">
<content select="[navigation]"></content>
</section>
<section id="scrim" on-tap="{{menuActionTap}}" offscreen="right"></section>
<polymer-ui-toolbar offscreen="basement">
<polymer-ui-icon-button icon="menu" hidden?="{{hideMenuButton}}" on-tap="{{menuActionTap}}" active="{{menuActive}}"></polymer-ui-icon-button>
<content select="[tool]"></content>
</polymer-ui-toolbar>
<section offscreen="basement">
<content select="*"></content>
</section>
</template>
<script>
(function() {
Polymer('polymer-ui-scaffold3', {
menuActive: false,
hideMenuButton: false,
layouts: {
main:[
[3, 3],
[4, 4],
[4, 4]
],
menu: [
[1, 2],
[1, 2],
[1, 2]
]
},
ready: function() {
this.$.grid.layout = this.layouts.main;
},
menuActionTap: function() {
this.menuActive = !this.menuActive;
Platform.flush();
},
menuActiveChanged: function() {
this.$.grid.layout = this.layouts[this.menuActive ? 'menu' : 'main'];
}
});
})();
</script>
</polymer-element>