polymer-neon-rails 1.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +39 -0
  3. data/Rakefile +1 -0
  4. data/app/assets/components/iron-flex-layout/README.md +4 -0
  5. data/app/assets/components/iron-flex-layout/bower.json +21 -0
  6. data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
  7. data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
  8. data/app/assets/components/iron-flex-layout/demo/index.html +40 -0
  9. data/app/assets/components/iron-flex-layout/demo/x-app.html +106 -0
  10. data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
  11. data/app/assets/components/iron-meta/README.md +46 -0
  12. data/app/assets/components/iron-meta/bower.json +28 -0
  13. data/app/assets/components/iron-meta/demo/index.html +45 -0
  14. data/app/assets/components/iron-meta/hero.svg +33 -0
  15. data/app/assets/components/iron-meta/index.html +27 -0
  16. data/app/assets/components/iron-meta/iron-meta.html +352 -0
  17. data/app/assets/components/iron-meta/test/basic.html +48 -0
  18. data/app/assets/components/iron-meta/test/index.html +30 -0
  19. data/app/assets/components/iron-meta/test/iron-meta.html +186 -0
  20. data/app/assets/components/iron-resizable-behavior/README.md +16 -0
  21. data/app/assets/components/iron-resizable-behavior/bower.json +26 -0
  22. data/app/assets/components/iron-resizable-behavior/demo/index.html +29 -0
  23. data/app/assets/components/iron-resizable-behavior/demo/src/x-app.html +114 -0
  24. data/app/assets/components/iron-resizable-behavior/index.html +25 -0
  25. data/app/assets/components/iron-resizable-behavior/iron-resizable-behavior.html +139 -0
  26. data/app/assets/components/iron-resizable-behavior/test/basic.html +263 -0
  27. data/app/assets/components/iron-resizable-behavior/test/index.html +31 -0
  28. data/app/assets/components/iron-resizable-behavior/test/test-elements.html +143 -0
  29. data/app/assets/components/iron-selector/README.md +50 -0
  30. data/app/assets/components/iron-selector/bower.json +31 -0
  31. data/app/assets/components/iron-selector/demo/index.html +66 -0
  32. data/app/assets/components/iron-selector/index.html +28 -0
  33. data/app/assets/components/iron-selector/iron-multi-selectable.html +120 -0
  34. data/app/assets/components/iron-selector/iron-selectable.html +307 -0
  35. data/app/assets/components/iron-selector/iron-selection.html +115 -0
  36. data/app/assets/components/iron-selector/iron-selector.html +71 -0
  37. data/app/assets/components/iron-selector/test/activate-event.html +138 -0
  38. data/app/assets/components/iron-selector/test/basic.html +150 -0
  39. data/app/assets/components/iron-selector/test/content-element.html +43 -0
  40. data/app/assets/components/iron-selector/test/content.html +168 -0
  41. data/app/assets/components/iron-selector/test/index.html +36 -0
  42. data/app/assets/components/iron-selector/test/multi.html +135 -0
  43. data/app/assets/components/iron-selector/test/next-previous.html +134 -0
  44. data/app/assets/components/iron-selector/test/selected-attribute.html +72 -0
  45. data/app/assets/components/iron-selector/test/template-repeat.html +110 -0
  46. data/app/assets/components/neon-animation/README.md +304 -0
  47. data/app/assets/components/neon-animation/animations/cascaded-animation.html +84 -0
  48. data/app/assets/components/neon-animation/animations/fade-in-animation.html +49 -0
  49. data/app/assets/components/neon-animation/animations/fade-out-animation.html +49 -0
  50. data/app/assets/components/neon-animation/animations/hero-animation.html +83 -0
  51. data/app/assets/components/neon-animation/animations/opaque-animation.html +46 -0
  52. data/app/assets/components/neon-animation/animations/ripple-animation.html +92 -0
  53. data/app/assets/components/neon-animation/animations/scale-down-animation.html +65 -0
  54. data/app/assets/components/neon-animation/animations/scale-up-animation.html +58 -0
  55. data/app/assets/components/neon-animation/animations/slide-down-animation.html +59 -0
  56. data/app/assets/components/neon-animation/animations/slide-from-left-animation.html +60 -0
  57. data/app/assets/components/neon-animation/animations/slide-from-right-animation.html +60 -0
  58. data/app/assets/components/neon-animation/animations/slide-left-animation.html +59 -0
  59. data/app/assets/components/neon-animation/animations/slide-right-animation.html +59 -0
  60. data/app/assets/components/neon-animation/animations/slide-up-animation.html +59 -0
  61. data/app/assets/components/neon-animation/animations/transform-animation.html +61 -0
  62. data/app/assets/components/neon-animation/bower.json +51 -0
  63. data/app/assets/components/neon-animation/demo/declarative/index.html +108 -0
  64. data/app/assets/components/neon-animation/demo/doc/basic.html +47 -0
  65. data/app/assets/components/neon-animation/demo/doc/my-animatable.html +73 -0
  66. data/app/assets/components/neon-animation/demo/doc/my-dialog.html +97 -0
  67. data/app/assets/components/neon-animation/demo/doc/types.html +53 -0
  68. data/app/assets/components/neon-animation/demo/dropdown/animated-dropdown.html +97 -0
  69. data/app/assets/components/neon-animation/demo/dropdown/index.html +54 -0
  70. data/app/assets/components/neon-animation/demo/grid/animated-grid.html +166 -0
  71. data/app/assets/components/neon-animation/demo/grid/fullsize-page-with-card.html +124 -0
  72. data/app/assets/components/neon-animation/demo/grid/index.html +70 -0
  73. data/app/assets/components/neon-animation/demo/index.html +6 -0
  74. data/app/assets/components/neon-animation/demo/list/full-view.html +122 -0
  75. data/app/assets/components/neon-animation/demo/list/index.html +29 -0
  76. data/app/assets/components/neon-animation/demo/list/list-demo.html +112 -0
  77. data/app/assets/components/neon-animation/demo/list/list-view.html +127 -0
  78. data/app/assets/components/neon-animation/demo/load/animated-grid.html +147 -0
  79. data/app/assets/components/neon-animation/demo/load/full-page.html +86 -0
  80. data/app/assets/components/neon-animation/demo/load/index.html +45 -0
  81. data/app/assets/components/neon-animation/demo/reprojection/animated-grid.html +166 -0
  82. data/app/assets/components/neon-animation/demo/reprojection/fullsize-page-with-card.html +124 -0
  83. data/app/assets/components/neon-animation/demo/reprojection/index.html +66 -0
  84. data/app/assets/components/neon-animation/demo/reprojection/reprojected-pages.html +42 -0
  85. data/app/assets/components/neon-animation/demo/shared.css +40 -0
  86. data/app/assets/components/neon-animation/demo/tiles/circles-page.html +110 -0
  87. data/app/assets/components/neon-animation/demo/tiles/index.html +77 -0
  88. data/app/assets/components/neon-animation/demo/tiles/squares-page.html +104 -0
  89. data/app/assets/components/neon-animation/guides/neon-animation.md +313 -0
  90. data/app/assets/components/neon-animation/index.html +30 -0
  91. data/app/assets/components/neon-animation/neon-animatable-behavior.html +156 -0
  92. data/app/assets/components/neon-animation/neon-animatable.html +54 -0
  93. data/app/assets/components/neon-animation/neon-animated-pages.html +208 -0
  94. data/app/assets/components/neon-animation/neon-animation-behavior.html +88 -0
  95. data/app/assets/components/neon-animation/neon-animation-runner-behavior.html +110 -0
  96. data/app/assets/components/neon-animation/neon-animation.html +17 -0
  97. data/app/assets/components/neon-animation/neon-animations.html +25 -0
  98. data/app/assets/components/neon-animation/neon-shared-element-animatable-behavior.html +37 -0
  99. data/app/assets/components/neon-animation/neon-shared-element-animation-behavior.html +66 -0
  100. data/app/assets/components/neon-animation/web-animations.html +11 -0
  101. data/app/assets/components/neon-elements/README.md +19 -0
  102. data/app/assets/components/neon-elements/bower.json +26 -0
  103. data/app/assets/components/paper-styles/README.md +3 -0
  104. data/app/assets/components/paper-styles/bower.json +27 -0
  105. data/app/assets/components/paper-styles/classes/global.html +96 -0
  106. data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
  107. data/app/assets/components/paper-styles/classes/shadow.html +39 -0
  108. data/app/assets/components/paper-styles/classes/typography.html +171 -0
  109. data/app/assets/components/paper-styles/color.html +333 -0
  110. data/app/assets/components/paper-styles/default-theme.html +39 -0
  111. data/app/assets/components/paper-styles/demo-pages.html +72 -0
  112. data/app/assets/components/paper-styles/demo.css +25 -0
  113. data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
  114. data/app/assets/components/paper-styles/paper-styles.html +17 -0
  115. data/app/assets/components/paper-styles/shadow.html +61 -0
  116. data/app/assets/components/paper-styles/typography.html +240 -0
  117. data/app/assets/components/polymer/LICENSE.txt +27 -0
  118. data/app/assets/components/polymer/bower.json +26 -0
  119. data/app/assets/components/polymer/build.log +27 -0
  120. data/app/assets/components/polymer/polymer-micro.html +523 -0
  121. data/app/assets/components/polymer/polymer-mini.html +1368 -0
  122. data/app/assets/components/polymer/polymer.html +3768 -0
  123. data/app/assets/components/web-animations-js/COPYING +202 -0
  124. data/app/assets/components/web-animations-js/History.md +108 -0
  125. data/app/assets/components/web-animations-js/README.md +161 -0
  126. data/app/assets/components/web-animations-js/bower.json +31 -0
  127. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
  128. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js.map +1 -0
  129. data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
  130. data/app/assets/components/web-animations-js/web-animations-next.min.js.map +1 -0
  131. data/app/assets/components/web-animations-js/web-animations.html +50 -0
  132. data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
  133. data/app/assets/components/web-animations-js/web-animations.min.js.gz +0 -0
  134. data/app/assets/components/web-animations-js/web-animations.min.js.map +1 -0
  135. data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
  136. data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
  137. data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
  138. data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
  139. data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
  140. data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
  141. data/app/assets/components/webcomponentsjs/README.md +125 -0
  142. data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
  143. data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
  144. data/app/assets/components/webcomponentsjs/bower.json +14 -0
  145. data/app/assets/components/webcomponentsjs/build.log +33 -0
  146. data/app/assets/components/webcomponentsjs/package.json +31 -0
  147. data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
  148. data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
  149. data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
  150. data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
  151. data/lib/polymer-neon-rails.rb +2 -0
  152. data/lib/polymer-neon-rails/engine.rb +4 -0
  153. data/lib/polymer-neon-rails/version.rb +3 -0
  154. metadata +264 -0
@@ -0,0 +1,48 @@
1
+ <!doctype html>
2
+ <!--
3
+ @license
4
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ -->
11
+
12
+ <html>
13
+ <head>
14
+
15
+ <title>iron-meta-basic</title>
16
+ <meta charset="utf-8">
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+
19
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
20
+ <script src="../../web-component-tester/browser.js"></script>
21
+
22
+ <link rel="import" href="../iron-meta.html">
23
+
24
+ </head>
25
+ <body>
26
+
27
+ <iron-meta key="info" value="foo/bar"></iron-meta>
28
+
29
+ <script>
30
+
31
+ suite('basic', function() {
32
+
33
+ test('byKey', function() {
34
+ var meta = document.createElement('iron-meta');
35
+ assert.equal(meta.byKey('info'), 'foo/bar');
36
+ });
37
+
38
+ test('list', function() {
39
+ var meta = document.createElement('iron-meta');
40
+ assert.equal(meta.list.length, 1);
41
+ });
42
+
43
+ });
44
+
45
+ </script>
46
+
47
+ </body>
48
+ </html>
@@ -0,0 +1,30 @@
1
+ <!doctype html>
2
+ <!--
3
+ @license
4
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ -->
11
+
12
+ <html>
13
+ <head>
14
+
15
+ <meta charset="utf-8">
16
+ <title>Tests</title>
17
+ <script src="../../web-component-tester/browser.js"></script>
18
+
19
+ </head>
20
+ <body>
21
+
22
+ <script>
23
+ WCT.loadSuites([
24
+ 'basic.html',
25
+ 'iron-meta.html'
26
+ ]);
27
+ </script>
28
+
29
+ </body>
30
+ </html>
@@ -0,0 +1,186 @@
1
+ <!doctype html>
2
+ <!--
3
+ @license
4
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ -->
11
+
12
+ <html>
13
+ <head>
14
+
15
+ <title>iron-meta</title>
16
+ <meta charset="utf-8">
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+
19
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
20
+ <script src="../../web-component-tester/browser.js"></script>
21
+ <script src="../../test-fixture/test-fixture-mocha.js"></script>
22
+
23
+ <link rel="import" href="../iron-meta.html">
24
+ <link rel="import" href="../../test-fixture/test-fixture.html">
25
+
26
+ </head>
27
+ <body>
28
+
29
+ <test-fixture id="TrivialMeta">
30
+ <template>
31
+ <iron-meta self key="info"></iron-meta>
32
+ </template>
33
+ </test-fixture>
34
+
35
+ <test-fixture id="ManyMetas">
36
+ <template>
37
+ <iron-meta self key="default1"></iron-meta>
38
+ <iron-meta self key="default2"></iron-meta>
39
+ <iron-meta self key="default3"></iron-meta>
40
+ </template>
41
+ </test-fixture>
42
+
43
+ <test-fixture id="DifferentTypedMetas">
44
+ <template>
45
+ <iron-meta self type="foo" key="foobarKey"></iron-meta>
46
+ <iron-meta self type="bar" key="foobarKey"></iron-meta>
47
+ <iron-meta self key="defaultKey"></iron-meta>
48
+ </template>
49
+ </test-fixture>
50
+
51
+ <test-fixture id="ClashingMetas">
52
+ <template>
53
+ <iron-meta self key="baz"></iron-meta>
54
+ <iron-meta self key="baz"></iron-meta>
55
+ </template>
56
+ </test-fixture>
57
+
58
+ <script>
59
+ suite('<iron-meta>', function () {
60
+ suite('basic behavior', function () {
61
+ var meta;
62
+
63
+ setup(function () {
64
+ meta = fixture('TrivialMeta');
65
+ });
66
+
67
+ teardown(function () {
68
+ meta.key = null;
69
+ });
70
+
71
+ test('uses itself as the default value', function () {
72
+ expect(meta.value).to.be.equal(meta);
73
+ });
74
+
75
+ test('can be assigned alternative values', function () {
76
+ meta.value = 'foobar';
77
+
78
+ expect(meta.list[0]).to.be.equal('foobar');
79
+ });
80
+
81
+ test('can access same-type meta values by key', function () {
82
+ expect(meta.byKey(meta.key)).to.be.equal(meta.value);
83
+ });
84
+
85
+ test('yields a list of same-type meta data', function () {
86
+ expect(meta.list).to.be.ok;
87
+ expect(meta.list.length).to.be.equal(1);
88
+ expect(meta.list[0]).to.be.equal(meta);
89
+ });
90
+ });
91
+
92
+ suite('many same-typed metas', function () {
93
+ var metas;
94
+
95
+ setup(function () {
96
+ metas = fixture('ManyMetas');
97
+ });
98
+
99
+ teardown(function () {
100
+ metas.forEach(function (meta) {
101
+ meta.key = null;
102
+ });
103
+ });
104
+
105
+ test('all cache all meta values', function () {
106
+ metas.forEach(function (meta, index) {
107
+ expect(meta.list.length).to.be.equal(metas.length);
108
+ expect(meta.list[index].value).to.be.equal(meta.value);
109
+ });
110
+ });
111
+
112
+ test('can be unregistered individually', function () {
113
+ metas[0].key = null;
114
+
115
+ expect(metas[0].list.length).to.be.equal(2);
116
+ expect(metas[0].list).to.be.deep.equal([metas[1], metas[2]])
117
+ });
118
+
119
+ test('can access each others value by key', function () {
120
+ expect(metas[0].byKey('default2')).to.be.equal(metas[1].value);
121
+ });
122
+ });
123
+
124
+ suite('different-typed metas', function () {
125
+ var metas;
126
+
127
+ setup(function () {
128
+ metas = fixture('DifferentTypedMetas');
129
+ });
130
+
131
+ teardown(function () {
132
+ metas.forEach(function (meta) {
133
+ meta.key = null;
134
+ });
135
+ });
136
+
137
+ test('cache their values separately', function () {
138
+ var fooMeta = metas[0];
139
+ var barMeta = metas[1];
140
+
141
+ expect(fooMeta.value).to.not.be.equal(barMeta.value);
142
+ expect(fooMeta.byKey('foobarKey')).to.be.equal(fooMeta.value);
143
+ expect(barMeta.byKey('foobarKey')).to.be.equal(barMeta.value);
144
+ });
145
+
146
+ test('cannot access values of other types', function () {
147
+ var defaultMeta = metas[2];
148
+
149
+ expect(defaultMeta.byKey('foobarKey')).to.be.equal(undefined);
150
+ });
151
+
152
+ test('only list values of their type', function () {
153
+ metas.forEach(function (meta) {
154
+ expect(meta.list.length).to.be.equal(1);
155
+ expect(meta.list[0]).to.be.equal(meta.value);
156
+ })
157
+ });
158
+ });
159
+
160
+ suite('metas with clashing keys', function () {
161
+ var metaPair;
162
+
163
+ setup(function () {
164
+ metaPair = fixture('ClashingMetas');
165
+ });
166
+
167
+ teardown(function () {
168
+ metaPair.forEach(function (meta) {
169
+ meta.key = null;
170
+ });
171
+ });
172
+
173
+ test('let the last value win registration against the key', function () {
174
+ var registeredValue = metaPair[0].byKey(metaPair[0].key);
175
+ var firstValue = metaPair[0].value;
176
+ var secondValue = metaPair[1].value;
177
+
178
+ expect(registeredValue).to.not.be.equal(firstValue);
179
+ expect(registeredValue).to.be.equal(secondValue);
180
+ });
181
+ });
182
+ });
183
+ </script>
184
+
185
+ </body>
186
+ </html>
@@ -0,0 +1,16 @@
1
+ iron-resizable-behavior
2
+ =======================
3
+
4
+ `IronResizableBehavior` is a behavior that can be used in Polymer elements to
5
+ coordinate the flow of resize events between "resizers" (elements that control the
6
+ size or hidden state of their children) and "resizables" (elements that need to be
7
+ notified when they are resized or un-hidden by their parents in order to take
8
+ action on their new measurements).
9
+
10
+ Elements that perform measurement should add the `IronResizableBehavior` behavior to
11
+ their element definition and listen for the `iron-resize` event on themselves.
12
+ This event will be fired when they become showing after having been hidden,
13
+ when they are resized explicitly by another resizable, or when the window has been
14
+ resized.
15
+
16
+ Note, the `iron-resize` event is non-bubbling.
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "iron-resizable-behavior",
3
+ "version": "1.0.0",
4
+ "license": "http://polymer.github.io/LICENSE.txt",
5
+ "description": "Coordinates the flow of resizeable elements",
6
+ "private": true,
7
+ "main": "iron-resizable-behavior.html",
8
+ "authors": [
9
+ "The Polymer Authors"
10
+ ],
11
+ "keywords": [
12
+ "web-components",
13
+ "polymer",
14
+ "iron",
15
+ "behavior"
16
+ ],
17
+ "dependencies": {
18
+ "polymer": "Polymer/polymer#^1.0.0"
19
+ },
20
+ "devDependencies": {
21
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
22
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
23
+ "web-component-tester": "*",
24
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
25
+ }
26
+ }
@@ -0,0 +1,29 @@
1
+ <!doctype html>
2
+ <!--
3
+ @license
4
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ -->
11
+
12
+ <html>
13
+ <head>
14
+
15
+ <title>iron-resizable-behavior demo</title>
16
+
17
+ <meta charset="utf-8">
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+
20
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
21
+ <link rel="import" href="src/x-app.html">
22
+
23
+ </head>
24
+ <body>
25
+
26
+ <x-app></x-app>
27
+
28
+ </body>
29
+ </html>
@@ -0,0 +1,114 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+
11
+ <link rel="import" href="../../iron-resizable-behavior.html">
12
+
13
+ <dom-module id="x-puck">
14
+
15
+ <style>
16
+
17
+ :host {
18
+ display: inline-block;
19
+ border: 3px solid lightblue;
20
+ }
21
+
22
+ </style>
23
+
24
+ <template>
25
+
26
+ <b>I'm a resize-aware, thirdifying puck at (<span>{{x}}</span> x <span>{{y}}</span>).</b>
27
+
28
+ </template>
29
+
30
+ </dom-module>
31
+
32
+ <script>
33
+
34
+ Polymer({
35
+
36
+ is: 'x-puck',
37
+
38
+ behaviors: [
39
+ Polymer.IronResizableBehavior
40
+ ],
41
+
42
+ properties: {
43
+ x: {
44
+ type: Number,
45
+ value: 0
46
+ },
47
+
48
+ y: {
49
+ type: Number,
50
+ value: 0
51
+ }
52
+ },
53
+
54
+ listeners: {
55
+ 'iron-resize': '_onIronResize'
56
+ },
57
+
58
+ attached: function() {
59
+ this.async(this.notifyResize, 1);
60
+ },
61
+
62
+ get parent() {
63
+ if (this.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
64
+ return this.parentNode.host;
65
+ }
66
+
67
+ return this.parentNode;
68
+ },
69
+
70
+ _onIronResize: function() {
71
+ var x = this.x = Math.floor(this.parent.offsetWidth / 3);
72
+ var y = this.y = Math.floor(this.parent.offsetHeight / 3);
73
+
74
+ this.translate3d(x + 'px', y + 'px', 0);
75
+ }
76
+ });
77
+
78
+ </script>
79
+
80
+ <dom-module id="x-app">
81
+
82
+ <style>
83
+
84
+ :host {
85
+ display: block;
86
+ position: absolute;
87
+ top: 0;
88
+ right: 0;
89
+ bottom: 0;
90
+ left: 0;
91
+ }
92
+
93
+ </style>
94
+
95
+ <template>
96
+
97
+ <x-puck></x-puck>
98
+
99
+ </template>
100
+
101
+ </dom-module>
102
+
103
+ <script>
104
+
105
+ Polymer({
106
+
107
+ is: 'x-app',
108
+
109
+ behaviors: [
110
+ Polymer.IronResizableBehavior
111
+ ]
112
+ });
113
+
114
+ </script>