-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
176 lines (163 loc) · 4.97 KB
/
index.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="k/k-calendar.html" />
<link rel="import" href="k/k-datepicker.html" />
<link rel="import" href="k/k-menu.html" />
<link rel="import" href="k/k-window.html" />
<link rel="stylesheet" href="kendo/css/web/kendo.common.min.css" shim-shadowdom />
<link rel="stylesheet" href="kendo/css/web/kendo.default.min.css" shim-shadowdom />
<style>
body {
font: 12px arial,sans-serif;
}
</style>
</head>
<body unresolved touch-action="auto">
<polymer-element name="my-test" attributes="test">
<template>
<p>
Data binding on <tt>value</tt>. Both calendars and the text below
are bound to a Date element in the "model".
</p>
<k-calendar value="{{calendarValue}}" footer="{{dasFooter}}"></k-calendar>
<k-calendar value="{{calendarValue}}"></k-calendar>
<p>
Value is {{ calendarValue }}. <button on-click="{{setToday}}">Set to today</button>
</p>
<p>
<k-datepicker value="{{calendarValue}}"></k-datepicker>
</p>
<k-menu dataSource="{{menu}}"></k-menu>
<p>
Submenus are wrongfully positioned for some reason.
</p>
<k-menu>
<li>Foo
<ul>
<li>Foo 1
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
<li>Foo 2
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
<li>Foo 3
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
</ul>
</li>
<li>Foo
<ul>
<li>Foo 1
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
<li>Foo 2
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
<li>Foo 3
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
</ul>
</li>
<li>Foo
<ul>
<li>Foo 1
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
<li>Foo 2
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
<li>Foo 3
<ul>
<li>Foo 1</li>
<li>Foo 2</li>
<li>Foo 3</li>
</ul>
</li>
</ul>
</li>
</k-menu>
<k-window id="window" draggable="true" resizable="true"
title="{{windowTitle}}" modal="true" width="400" height="300">
<h2>Weirdo</h2>
<p>
Title binding does not work. It does work in the following input though:
</p>
<input value="{{windowTitle}}" />
<p>
It seems to be because the name of the attribute is "title".
If I manually change k-window.html to assign another attribute
to options.title, then it does work. This means that in order
to provide reliable options without clashing with other oddities
that may be, we would have to prefix the names like we do in
Angular.
</p>
</k-window>
<p>
<button on-click="{{popupWindow}}">{{windowTitle}}</button>
</p>
</template>
<script>
Polymer("my-test", {
calendarValue: new Date(2014, 0, 24),
setToday: function() {
this.calendarValue = new Date();
},
dasFooter: "Foo bar baz",
menu: [
{ text: "foo", items: [
{ text: "foo 1.1" },
{ text: "foo 1.2" },
{ text: "foo 1.3" },
] },
{ text: "bar" },
{ text: "baz", items: [
{ text: "bar 1.1" },
{ text: "bar 1.2" },
{ text: "bar 1.3" },
] }
],
popupWindow: function() {
this.$.window.kendoWidget.open().center();
},
windowTitle: "Hello Polymer"
});
</script>
</polymer-element>
<my-test></my-test>
</body>
</html>