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.
- checksums.yaml +7 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/app/assets/components/iron-flex-layout/README.md +4 -0
- data/app/assets/components/iron-flex-layout/bower.json +21 -0
- data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
- data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
- data/app/assets/components/iron-flex-layout/demo/index.html +40 -0
- data/app/assets/components/iron-flex-layout/demo/x-app.html +106 -0
- data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
- data/app/assets/components/iron-meta/README.md +46 -0
- data/app/assets/components/iron-meta/bower.json +28 -0
- data/app/assets/components/iron-meta/demo/index.html +45 -0
- data/app/assets/components/iron-meta/hero.svg +33 -0
- data/app/assets/components/iron-meta/index.html +27 -0
- data/app/assets/components/iron-meta/iron-meta.html +352 -0
- data/app/assets/components/iron-meta/test/basic.html +48 -0
- data/app/assets/components/iron-meta/test/index.html +30 -0
- data/app/assets/components/iron-meta/test/iron-meta.html +186 -0
- data/app/assets/components/iron-resizable-behavior/README.md +16 -0
- data/app/assets/components/iron-resizable-behavior/bower.json +26 -0
- data/app/assets/components/iron-resizable-behavior/demo/index.html +29 -0
- data/app/assets/components/iron-resizable-behavior/demo/src/x-app.html +114 -0
- data/app/assets/components/iron-resizable-behavior/index.html +25 -0
- data/app/assets/components/iron-resizable-behavior/iron-resizable-behavior.html +139 -0
- data/app/assets/components/iron-resizable-behavior/test/basic.html +263 -0
- data/app/assets/components/iron-resizable-behavior/test/index.html +31 -0
- data/app/assets/components/iron-resizable-behavior/test/test-elements.html +143 -0
- data/app/assets/components/iron-selector/README.md +50 -0
- data/app/assets/components/iron-selector/bower.json +31 -0
- data/app/assets/components/iron-selector/demo/index.html +66 -0
- data/app/assets/components/iron-selector/index.html +28 -0
- data/app/assets/components/iron-selector/iron-multi-selectable.html +120 -0
- data/app/assets/components/iron-selector/iron-selectable.html +307 -0
- data/app/assets/components/iron-selector/iron-selection.html +115 -0
- data/app/assets/components/iron-selector/iron-selector.html +71 -0
- data/app/assets/components/iron-selector/test/activate-event.html +138 -0
- data/app/assets/components/iron-selector/test/basic.html +150 -0
- data/app/assets/components/iron-selector/test/content-element.html +43 -0
- data/app/assets/components/iron-selector/test/content.html +168 -0
- data/app/assets/components/iron-selector/test/index.html +36 -0
- data/app/assets/components/iron-selector/test/multi.html +135 -0
- data/app/assets/components/iron-selector/test/next-previous.html +134 -0
- data/app/assets/components/iron-selector/test/selected-attribute.html +72 -0
- data/app/assets/components/iron-selector/test/template-repeat.html +110 -0
- data/app/assets/components/neon-animation/README.md +304 -0
- data/app/assets/components/neon-animation/animations/cascaded-animation.html +84 -0
- data/app/assets/components/neon-animation/animations/fade-in-animation.html +49 -0
- data/app/assets/components/neon-animation/animations/fade-out-animation.html +49 -0
- data/app/assets/components/neon-animation/animations/hero-animation.html +83 -0
- data/app/assets/components/neon-animation/animations/opaque-animation.html +46 -0
- data/app/assets/components/neon-animation/animations/ripple-animation.html +92 -0
- data/app/assets/components/neon-animation/animations/scale-down-animation.html +65 -0
- data/app/assets/components/neon-animation/animations/scale-up-animation.html +58 -0
- data/app/assets/components/neon-animation/animations/slide-down-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/slide-from-left-animation.html +60 -0
- data/app/assets/components/neon-animation/animations/slide-from-right-animation.html +60 -0
- data/app/assets/components/neon-animation/animations/slide-left-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/slide-right-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/slide-up-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/transform-animation.html +61 -0
- data/app/assets/components/neon-animation/bower.json +51 -0
- data/app/assets/components/neon-animation/demo/declarative/index.html +108 -0
- data/app/assets/components/neon-animation/demo/doc/basic.html +47 -0
- data/app/assets/components/neon-animation/demo/doc/my-animatable.html +73 -0
- data/app/assets/components/neon-animation/demo/doc/my-dialog.html +97 -0
- data/app/assets/components/neon-animation/demo/doc/types.html +53 -0
- data/app/assets/components/neon-animation/demo/dropdown/animated-dropdown.html +97 -0
- data/app/assets/components/neon-animation/demo/dropdown/index.html +54 -0
- data/app/assets/components/neon-animation/demo/grid/animated-grid.html +166 -0
- data/app/assets/components/neon-animation/demo/grid/fullsize-page-with-card.html +124 -0
- data/app/assets/components/neon-animation/demo/grid/index.html +70 -0
- data/app/assets/components/neon-animation/demo/index.html +6 -0
- data/app/assets/components/neon-animation/demo/list/full-view.html +122 -0
- data/app/assets/components/neon-animation/demo/list/index.html +29 -0
- data/app/assets/components/neon-animation/demo/list/list-demo.html +112 -0
- data/app/assets/components/neon-animation/demo/list/list-view.html +127 -0
- data/app/assets/components/neon-animation/demo/load/animated-grid.html +147 -0
- data/app/assets/components/neon-animation/demo/load/full-page.html +86 -0
- data/app/assets/components/neon-animation/demo/load/index.html +45 -0
- data/app/assets/components/neon-animation/demo/reprojection/animated-grid.html +166 -0
- data/app/assets/components/neon-animation/demo/reprojection/fullsize-page-with-card.html +124 -0
- data/app/assets/components/neon-animation/demo/reprojection/index.html +66 -0
- data/app/assets/components/neon-animation/demo/reprojection/reprojected-pages.html +42 -0
- data/app/assets/components/neon-animation/demo/shared.css +40 -0
- data/app/assets/components/neon-animation/demo/tiles/circles-page.html +110 -0
- data/app/assets/components/neon-animation/demo/tiles/index.html +77 -0
- data/app/assets/components/neon-animation/demo/tiles/squares-page.html +104 -0
- data/app/assets/components/neon-animation/guides/neon-animation.md +313 -0
- data/app/assets/components/neon-animation/index.html +30 -0
- data/app/assets/components/neon-animation/neon-animatable-behavior.html +156 -0
- data/app/assets/components/neon-animation/neon-animatable.html +54 -0
- data/app/assets/components/neon-animation/neon-animated-pages.html +208 -0
- data/app/assets/components/neon-animation/neon-animation-behavior.html +88 -0
- data/app/assets/components/neon-animation/neon-animation-runner-behavior.html +110 -0
- data/app/assets/components/neon-animation/neon-animation.html +17 -0
- data/app/assets/components/neon-animation/neon-animations.html +25 -0
- data/app/assets/components/neon-animation/neon-shared-element-animatable-behavior.html +37 -0
- data/app/assets/components/neon-animation/neon-shared-element-animation-behavior.html +66 -0
- data/app/assets/components/neon-animation/web-animations.html +11 -0
- data/app/assets/components/neon-elements/README.md +19 -0
- data/app/assets/components/neon-elements/bower.json +26 -0
- data/app/assets/components/paper-styles/README.md +3 -0
- data/app/assets/components/paper-styles/bower.json +27 -0
- data/app/assets/components/paper-styles/classes/global.html +96 -0
- data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
- data/app/assets/components/paper-styles/classes/shadow.html +39 -0
- data/app/assets/components/paper-styles/classes/typography.html +171 -0
- data/app/assets/components/paper-styles/color.html +333 -0
- data/app/assets/components/paper-styles/default-theme.html +39 -0
- data/app/assets/components/paper-styles/demo-pages.html +72 -0
- data/app/assets/components/paper-styles/demo.css +25 -0
- data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
- data/app/assets/components/paper-styles/paper-styles.html +17 -0
- data/app/assets/components/paper-styles/shadow.html +61 -0
- data/app/assets/components/paper-styles/typography.html +240 -0
- data/app/assets/components/polymer/LICENSE.txt +27 -0
- data/app/assets/components/polymer/bower.json +26 -0
- data/app/assets/components/polymer/build.log +27 -0
- data/app/assets/components/polymer/polymer-micro.html +523 -0
- data/app/assets/components/polymer/polymer-mini.html +1368 -0
- data/app/assets/components/polymer/polymer.html +3768 -0
- data/app/assets/components/web-animations-js/COPYING +202 -0
- data/app/assets/components/web-animations-js/History.md +108 -0
- data/app/assets/components/web-animations-js/README.md +161 -0
- data/app/assets/components/web-animations-js/bower.json +31 -0
- data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations-next-lite.min.js.map +1 -0
- data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations-next.min.js.map +1 -0
- data/app/assets/components/web-animations-js/web-animations.html +50 -0
- data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations.min.js.gz +0 -0
- data/app/assets/components/web-animations-js/web-animations.min.js.map +1 -0
- data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
- data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
- data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
- data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
- data/app/assets/components/webcomponentsjs/README.md +125 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
- data/app/assets/components/webcomponentsjs/bower.json +14 -0
- data/app/assets/components/webcomponentsjs/build.log +33 -0
- data/app/assets/components/webcomponentsjs/package.json +31 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
- data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
- data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
- data/lib/polymer-neon-rails.rb +2 -0
- data/lib/polymer-neon-rails/engine.rb +4 -0
- data/lib/polymer-neon-rails/version.rb +3 -0
- metadata +264 -0
@@ -0,0 +1,25 @@
|
|
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</title>
|
16
|
+
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
17
|
+
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
18
|
+
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
|
22
|
+
<iron-component-page></iron-component-page>
|
23
|
+
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,139 @@
|
|
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="../polymer/polymer.html">
|
12
|
+
|
13
|
+
<script>
|
14
|
+
/**
|
15
|
+
* `IronResizableBehavior` is a behavior that can be used in Polymer elements to
|
16
|
+
* coordinate the flow of resize events between "resizers" (elements that control the
|
17
|
+
* size or hidden state of their children) and "resizables" (elements that need to be
|
18
|
+
* notified when they are resized or un-hidden by their parents in order to take
|
19
|
+
* action on their new measurements).
|
20
|
+
* Elements that perform measurement should add the `IronResizableBehavior` behavior to
|
21
|
+
* their element definition and listen for the `iron-resize` event on themselves.
|
22
|
+
* This event will be fired when they become showing after having been hidden,
|
23
|
+
* when they are resized explicitly by another resizable, or when the window has been
|
24
|
+
* resized.
|
25
|
+
* Note, the `iron-resize` event is non-bubbling.
|
26
|
+
*
|
27
|
+
* @polymerBehavior Polymer.IronResizableBehavior
|
28
|
+
* @demo demo/index.html
|
29
|
+
**/
|
30
|
+
Polymer.IronResizableBehavior = {
|
31
|
+
properties: {
|
32
|
+
_parentResizable: {
|
33
|
+
type: Object,
|
34
|
+
observer: '_parentResizableChanged'
|
35
|
+
}
|
36
|
+
},
|
37
|
+
|
38
|
+
listeners: {
|
39
|
+
'iron-request-resize-notifications': '_onIronRequestResizeNotifications'
|
40
|
+
},
|
41
|
+
|
42
|
+
created: function() {
|
43
|
+
// We don't really need property effects on these, and also we want them
|
44
|
+
// to be created before the `_parentResizable` observer fires:
|
45
|
+
this._interestedResizables = [];
|
46
|
+
this._boundNotifyResize = this.notifyResize.bind(this);
|
47
|
+
},
|
48
|
+
|
49
|
+
attached: function() {
|
50
|
+
this.fire('iron-request-resize-notifications', null, {
|
51
|
+
node: this,
|
52
|
+
bubbles: true
|
53
|
+
});
|
54
|
+
|
55
|
+
if (!this._parentResizable) {
|
56
|
+
window.addEventListener('resize', this._boundNotifyResize);
|
57
|
+
this.notifyResize();
|
58
|
+
}
|
59
|
+
},
|
60
|
+
|
61
|
+
detached: function() {
|
62
|
+
if (this._parentResizable) {
|
63
|
+
this._parentResizable.stopResizeNotificationsFor(this);
|
64
|
+
} else {
|
65
|
+
window.removeEventListener('resize', this._boundNotifyResize);
|
66
|
+
}
|
67
|
+
|
68
|
+
this._parentResizable = null;
|
69
|
+
},
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Can be called to manually notify a resizable and its descendant
|
73
|
+
* resizables of a resize change.
|
74
|
+
*/
|
75
|
+
notifyResize: function() {
|
76
|
+
if (!this.isAttached) {
|
77
|
+
return;
|
78
|
+
}
|
79
|
+
|
80
|
+
this._interestedResizables.forEach(function(resizable) {
|
81
|
+
// TODO(cdata): Currently behaviors cannot define "abstract" methods..
|
82
|
+
if (!this.resizerShouldNotify || this.resizerShouldNotify(resizable)) {
|
83
|
+
resizable.notifyResize();
|
84
|
+
}
|
85
|
+
}, this);
|
86
|
+
|
87
|
+
this.fire('iron-resize', null, {
|
88
|
+
node: this,
|
89
|
+
bubbles: false
|
90
|
+
});
|
91
|
+
},
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Used to assign the closest resizable ancestor to this resizable
|
95
|
+
* if the ancestor detects a request for notifications.
|
96
|
+
*/
|
97
|
+
assignParentResizable: function(parentResizable) {
|
98
|
+
this._parentResizable = parentResizable;
|
99
|
+
},
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Used to remove a resizable descendant from the list of descendants
|
103
|
+
* that should be notified of a resize change.
|
104
|
+
*/
|
105
|
+
stopResizeNotificationsFor: function(target) {
|
106
|
+
var index = this._interestedResizables.indexOf(target);
|
107
|
+
|
108
|
+
if (index > -1) {
|
109
|
+
this._interestedResizables.splice(index, 1);
|
110
|
+
}
|
111
|
+
},
|
112
|
+
|
113
|
+
// TODO(cdata): Currently behaviors cannot define "abstract" methods.
|
114
|
+
// resizerShouldNotify: function(el) { return true; },
|
115
|
+
|
116
|
+
_parentResizableChanged: function(parentResizable) {
|
117
|
+
if (parentResizable) {
|
118
|
+
window.removeEventListener('resize', this._boundNotifyResize);
|
119
|
+
}
|
120
|
+
},
|
121
|
+
|
122
|
+
_onIronRequestResizeNotifications: function(event) {
|
123
|
+
var target = event.path ? event.path[0] : event.target;
|
124
|
+
|
125
|
+
if (target === this) {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
|
129
|
+
if (this._interestedResizables.indexOf(target) === -1) {
|
130
|
+
this._interestedResizables.push(target);
|
131
|
+
}
|
132
|
+
|
133
|
+
target.assignParentResizable(this);
|
134
|
+
|
135
|
+
event.stopPropagation();
|
136
|
+
}
|
137
|
+
};
|
138
|
+
</script>
|
139
|
+
|
@@ -0,0 +1,263 @@
|
|
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 tests</title>
|
16
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
17
|
+
|
18
|
+
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
19
|
+
<script src="../../web-component-tester/browser.js"></script>
|
20
|
+
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
21
|
+
|
22
|
+
<link rel="import" href="../../test-fixture/test-fixture.html">
|
23
|
+
<link rel="import" href="../iron-resizable-behavior.html">
|
24
|
+
<link rel="import" href="test-elements.html">
|
25
|
+
|
26
|
+
</head>
|
27
|
+
<body>
|
28
|
+
|
29
|
+
<!--
|
30
|
+
|
31
|
+
Notes on Polyfill compatibility in tests:
|
32
|
+
- Test elements loaded via imports, to ensure load order correctness
|
33
|
+
w.r.t. Polymer.mixin being availbale
|
34
|
+
- Resize notifications and asserts are done asynchronously, since
|
35
|
+
there are timing differences w.r.t. when detached callbacks occur
|
36
|
+
|
37
|
+
-->
|
38
|
+
|
39
|
+
<test-fixture id="TestElement">
|
40
|
+
<template>
|
41
|
+
<test-element></test-element>
|
42
|
+
</template>
|
43
|
+
</test-fixture>
|
44
|
+
|
45
|
+
|
46
|
+
<script>
|
47
|
+
|
48
|
+
suite('iron-resizable-behavior', function() {
|
49
|
+
function ListenForResize(el, expectsResize) {
|
50
|
+
var listener = function(event) {
|
51
|
+
var target = event.path ? event.path[0] : event.target;
|
52
|
+
pendingNotifications--;
|
53
|
+
};
|
54
|
+
|
55
|
+
if (expectsResize !== false) {
|
56
|
+
pendingNotifications++;
|
57
|
+
}
|
58
|
+
|
59
|
+
el.addEventListener('iron-resize', listener);
|
60
|
+
|
61
|
+
return {
|
62
|
+
el: el,
|
63
|
+
remove: function() {
|
64
|
+
el.removeEventListener('iron-resize', listener);
|
65
|
+
}
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
function RemoveListeners(listeners) {
|
70
|
+
listeners.forEach(function(listener) {
|
71
|
+
listener.remove();
|
72
|
+
});
|
73
|
+
}
|
74
|
+
|
75
|
+
var pendingNotifications;
|
76
|
+
var testEl;
|
77
|
+
|
78
|
+
setup(function() {
|
79
|
+
pendingNotifications = 0;
|
80
|
+
testEl = fixture('TestElement');
|
81
|
+
});
|
82
|
+
|
83
|
+
suite('x-resizer-parent', function() {
|
84
|
+
|
85
|
+
test('notify resizables from window', function(done) {
|
86
|
+
var listeners = [
|
87
|
+
ListenForResize(testEl.$.parent),
|
88
|
+
ListenForResize(testEl.$.child1a),
|
89
|
+
ListenForResize(testEl.$.child1b),
|
90
|
+
ListenForResize(testEl.$.shadow1c.$.resizable),
|
91
|
+
ListenForResize(testEl.$.shadow1d.$.resizable)
|
92
|
+
];
|
93
|
+
|
94
|
+
setTimeout(function() {
|
95
|
+
try {
|
96
|
+
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
97
|
+
|
98
|
+
expect(pendingNotifications).to.be.eql(0);
|
99
|
+
|
100
|
+
RemoveListeners(listeners);
|
101
|
+
|
102
|
+
done();
|
103
|
+
} catch (e) {
|
104
|
+
done(e);
|
105
|
+
}
|
106
|
+
}, 0);
|
107
|
+
});
|
108
|
+
|
109
|
+
test('notify resizables from parent', function(done) {
|
110
|
+
var listeners = [
|
111
|
+
ListenForResize(testEl.$.parent),
|
112
|
+
ListenForResize(testEl.$.child1a),
|
113
|
+
ListenForResize(testEl.$.child1b),
|
114
|
+
ListenForResize(testEl.$.shadow1c.$.resizable),
|
115
|
+
ListenForResize(testEl.$.shadow1d.$.resizable)
|
116
|
+
];
|
117
|
+
|
118
|
+
setTimeout(function() {
|
119
|
+
try {
|
120
|
+
testEl.$.parent.notifyResize();
|
121
|
+
expect(pendingNotifications).to.be.eql(0);
|
122
|
+
RemoveListeners(listeners);
|
123
|
+
done();
|
124
|
+
} catch (e) {
|
125
|
+
done(e);
|
126
|
+
}
|
127
|
+
}, 0);
|
128
|
+
});
|
129
|
+
|
130
|
+
test('detach resizables then notify parent', function(done) {
|
131
|
+
var listeners = [
|
132
|
+
ListenForResize(testEl.$.parent),
|
133
|
+
ListenForResize(testEl.$.child1a, false),
|
134
|
+
ListenForResize(testEl.$.child1b),
|
135
|
+
ListenForResize(testEl.$.shadow1c.$.resizable, false),
|
136
|
+
ListenForResize(testEl.$.shadow1d.$.resizable)
|
137
|
+
];
|
138
|
+
|
139
|
+
var el = Polymer.dom(testEl.root).querySelector('#child1a');
|
140
|
+
|
141
|
+
el.parentNode.removeChild(el);
|
142
|
+
el = Polymer.dom(testEl.root).querySelector('#shadow1c');
|
143
|
+
el.parentNode.removeChild(el);
|
144
|
+
|
145
|
+
setTimeout(function() {
|
146
|
+
try {
|
147
|
+
testEl.$.parent.notifyResize();
|
148
|
+
expect(pendingNotifications).to.be.eql(0);
|
149
|
+
RemoveListeners(listeners);
|
150
|
+
done();
|
151
|
+
} catch (e) {
|
152
|
+
done(e);
|
153
|
+
}
|
154
|
+
}, 0);
|
155
|
+
});
|
156
|
+
|
157
|
+
test('detach parent then notify window', function(done) {
|
158
|
+
var listeners = [
|
159
|
+
ListenForResize(testEl.$.parent, false),
|
160
|
+
ListenForResize(testEl.$.child1a, false),
|
161
|
+
ListenForResize(testEl.$.child1b, false),
|
162
|
+
ListenForResize(testEl.$.shadow1c.$.resizable, false),
|
163
|
+
ListenForResize(testEl.$.shadow1d.$.resizable, false)
|
164
|
+
];
|
165
|
+
|
166
|
+
var el = Polymer.dom(testEl.root).querySelector('#parent');
|
167
|
+
|
168
|
+
el.parentNode.removeChild(el);
|
169
|
+
|
170
|
+
setTimeout(function() {
|
171
|
+
try {
|
172
|
+
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
173
|
+
expect(pendingNotifications).to.be.eql(0);
|
174
|
+
RemoveListeners(listeners);
|
175
|
+
done();
|
176
|
+
} catch (e) {
|
177
|
+
done(e);
|
178
|
+
}
|
179
|
+
}, 0);
|
180
|
+
});
|
181
|
+
|
182
|
+
});
|
183
|
+
|
184
|
+
suite('x-resizer-parent-filtered', function() {
|
185
|
+
|
186
|
+
test('notify resizables from window', function(done) {
|
187
|
+
var listeners = [
|
188
|
+
ListenForResize(testEl.$.parentFiltered),
|
189
|
+
ListenForResize(testEl.$.child2a),
|
190
|
+
ListenForResize(testEl.$.child2b, false),
|
191
|
+
ListenForResize(testEl.$.shadow2c.$.resizable, false),
|
192
|
+
ListenForResize(testEl.$.shadow2d.$.resizable, false)
|
193
|
+
];
|
194
|
+
|
195
|
+
testEl.$.parentFiltered.active = testEl.$.child2a;
|
196
|
+
|
197
|
+
setTimeout(function() {
|
198
|
+
try {
|
199
|
+
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
200
|
+
expect(pendingNotifications).to.be.eql(0);
|
201
|
+
RemoveListeners(listeners);
|
202
|
+
done();
|
203
|
+
} catch (e) {
|
204
|
+
done(e);
|
205
|
+
}
|
206
|
+
}, 0);
|
207
|
+
});
|
208
|
+
|
209
|
+
test('notify resizables from parent', function(done) {
|
210
|
+
var listeners = [
|
211
|
+
ListenForResize(testEl.$.parentFiltered),
|
212
|
+
ListenForResize(testEl.$.child2a),
|
213
|
+
ListenForResize(testEl.$.child2b, false),
|
214
|
+
ListenForResize(testEl.$.shadow2c.$.resizable, false),
|
215
|
+
ListenForResize(testEl.$.shadow2d.$.resizable, false)
|
216
|
+
];
|
217
|
+
|
218
|
+
testEl.$.parentFiltered.active = testEl.$.child2a;
|
219
|
+
|
220
|
+
setTimeout(function() {
|
221
|
+
try {
|
222
|
+
testEl.$.parentFiltered.notifyResize();
|
223
|
+
expect(pendingNotifications).to.be.eql(0);
|
224
|
+
RemoveListeners(listeners);
|
225
|
+
done();
|
226
|
+
} catch (e) {
|
227
|
+
done(e);
|
228
|
+
}
|
229
|
+
}, 0);
|
230
|
+
});
|
231
|
+
|
232
|
+
test('detach resizables then notify parent', function(done) {
|
233
|
+
var listeners = [
|
234
|
+
ListenForResize(testEl.$.parentFiltered),
|
235
|
+
ListenForResize(testEl.$.child2a, false),
|
236
|
+
ListenForResize(testEl.$.child2b, false),
|
237
|
+
ListenForResize(testEl.$.shadow2c.$.resizable, false),
|
238
|
+
ListenForResize(testEl.$.shadow2d.$.resizable)
|
239
|
+
];
|
240
|
+
|
241
|
+
var el = Polymer.dom(testEl.root).querySelector('#child2a');
|
242
|
+
el.parentNode.removeChild(el);
|
243
|
+
el = Polymer.dom(testEl.root).querySelector('#shadow2c');
|
244
|
+
el.parentNode.removeChild(el);
|
245
|
+
|
246
|
+
testEl.$.parentFiltered.active = testEl.$.shadow2d.$.resizable;
|
247
|
+
|
248
|
+
setTimeout(function() {
|
249
|
+
try {
|
250
|
+
testEl.$.parentFiltered.notifyResize();
|
251
|
+
expect(pendingNotifications).to.be.eql(0);
|
252
|
+
RemoveListeners(listeners);
|
253
|
+
done();
|
254
|
+
} catch (e) {
|
255
|
+
done(e);
|
256
|
+
}
|
257
|
+
}, 0);
|
258
|
+
});
|
259
|
+
});
|
260
|
+
});
|
261
|
+
</script>
|
262
|
+
</body>
|
263
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
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
|
+
|
24
|
+
WCT.loadSuites([
|
25
|
+
'basic.html'
|
26
|
+
]);
|
27
|
+
|
28
|
+
</script>
|
29
|
+
|
30
|
+
</body>
|
31
|
+
</html>
|