polymer-paper-rails 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -18
- data/app/assets/components/core-a11y-keys/core-a11y-keys.html +4 -4
- data/app/assets/components/core-animation/web-animations.html +1 -1
- data/app/assets/components/core-collapse/core-collapse.html +1 -1
- data/app/assets/components/core-drawer-panel/core-drawer-panel.css +14 -6
- data/app/assets/components/core-drawer-panel/core-drawer-panel.html +32 -8
- data/app/assets/components/core-dropdown/core-dropdown.html +8 -2
- data/app/assets/components/core-icon/core-icon.html +0 -2
- data/app/assets/components/core-icons/av-icons.html +2 -9
- data/app/assets/components/core-icons/communication-icons.html +39 -42
- data/app/assets/components/core-icons/core-icons.html +231 -235
- data/app/assets/components/core-icons/device-icons.html +75 -90
- data/app/assets/components/core-icons/editor-icons.html +52 -52
- data/app/assets/components/core-icons/hardware-icons.html +40 -41
- data/app/assets/components/core-icons/image-icons.html +133 -137
- data/app/assets/components/core-icons/maps-icons.html +55 -57
- data/app/assets/components/core-icons/notification-icons.html +34 -34
- data/app/assets/components/core-icons/social-icons.html +23 -37
- data/app/assets/components/core-menu/core-menu.html +8 -3
- data/app/assets/components/core-menu/core-submenu.html +2 -2
- data/app/assets/components/core-overlay/core-key-helper.html +3 -0
- data/app/assets/components/core-overlay/core-overlay-layer.html +3 -0
- data/app/assets/components/core-overlay/core-overlay.html +20 -4
- data/app/assets/components/core-resizable/core-resizable.html +248 -0
- data/app/assets/components/core-scroll-header-panel/core-scroll-header-panel.html +14 -3
- data/app/assets/components/core-selection/core-selection.html +1 -1
- data/app/assets/components/core-selector/core-selector.html +26 -26
- data/app/assets/components/core-style/core-style.html +1 -1
- data/app/assets/components/core-toolbar/core-toolbar.html +1 -1
- data/app/assets/components/paper-button/paper-button-base.html +56 -12
- data/app/assets/components/paper-button/paper-button.html +22 -5
- data/app/assets/components/paper-checkbox/paper-checkbox.css +65 -184
- data/app/assets/components/paper-checkbox/paper-checkbox.html +47 -55
- data/app/assets/components/paper-dialog/paper-action-dialog.html +3 -3
- data/app/assets/components/paper-dialog/paper-dialog.html +2 -2
- data/app/assets/components/paper-dropdown-menu/paper-dropdown-menu.html +4 -1
- data/app/assets/components/{core-elements → paper-elements}/metadata.html +0 -0
- data/app/assets/components/{core-elements → paper-elements}/paper-elements.html +1 -0
- data/app/assets/components/paper-fab/paper-fab.html +2 -2
- data/app/assets/components/paper-input/paper-autogrow-textarea.html +8 -3
- data/app/assets/components/paper-input/paper-char-counter.html +121 -0
- data/app/assets/components/paper-input/paper-input-decorator.css +1 -21
- data/app/assets/components/paper-input/paper-input-decorator.html +130 -51
- data/app/assets/components/paper-input/paper-input.html +31 -5
- data/app/assets/components/paper-item/paper-item.html +1 -2
- data/app/assets/components/paper-progress/paper-progress.html +1 -1
- data/app/assets/components/paper-radio-button/paper-radio-button.css +16 -12
- data/app/assets/components/paper-radio-button/paper-radio-button.html +9 -3
- data/app/assets/components/paper-ripple/paper-ripple.html +2 -1
- data/app/assets/components/paper-shadow/paper-shadow.css +10 -10
- data/app/assets/components/paper-shadow/paper-shadow.html +8 -1
- data/app/assets/components/paper-slider/paper-slider.html +28 -4
- data/app/assets/components/paper-spinner/paper-spinner.css +35 -23
- data/app/assets/components/paper-spinner/paper-spinner.html +46 -5
- data/app/assets/components/paper-tabs/paper-tabs.css +5 -0
- data/app/assets/components/paper-tabs/paper-tabs.html +32 -7
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +58 -30
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html +69 -44
- data/app/assets/components/sampler-scaffold/sampler-scaffold.css +1 -1
- 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.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
- data/app/assets/components/webcomponentsjs/CustomElements.js +634 -0
- data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.js +764 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.js +4277 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +13 -0
- data/app/assets/components/webcomponentsjs/package.json +31 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.js +1728 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +11 -0
- data/app/assets/components/webcomponentsjs/webcomponents.js +6114 -0
- data/app/assets/components/webcomponentsjs/webcomponents.min.js +14 -0
- data/lib/polymer-paper-rails/version.rb +1 -1
- metadata +20 -71
- data/app/assets/components/core-dropdown/metadata.html +0 -62
- data/app/assets/components/core-icons/png-icons.html +0 -19
- data/app/assets/components/core-label/core-label.html +0 -124
- data/app/assets/components/core-overlay/tests/html/core-overlay-basic.html +0 -127
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning-margin.html +0 -153
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning.html +0 -167
- data/app/assets/components/core-overlay/tests/html/core-overlay-scroll.html +0 -130
- data/app/assets/components/core-overlay/tests/js/htmltests.js +0 -6
- data/app/assets/components/core-overlay/tests/runner.html +0 -14
- data/app/assets/components/core-overlay/tests/tests.json +0 -6
- data/app/assets/components/core-popup-menu/core-popup-menu.css +0 -28
- data/app/assets/components/core-popup-menu/core-popup-menu.html +0 -198
- data/app/assets/components/core-popup-menu/core-popup-overlay.html +0 -111
- data/app/assets/components/core-popup-menu/metadata.html +0 -62
- data/app/assets/components/paper-focusable/paper-focusable.html +0 -146
- data/app/assets/components/platform/platform.js +0 -16
- data/app/assets/components/web-animations-js/web-animations.js +0 -5529
- data/app/assets/components/web-animations-next/Gruntfile.js +0 -279
- data/app/assets/components/web-animations-next/History.md +0 -76
- data/app/assets/components/web-animations-next/package.json +0 -33
- data/app/assets/components/web-animations-next/src/animation-constructor.js +0 -139
- data/app/assets/components/web-animations-next/src/animation-node.js +0 -31
- data/app/assets/components/web-animations-next/src/animation.js +0 -65
- data/app/assets/components/web-animations-next/src/apply-preserving-inline-style.js +0 -192
- data/app/assets/components/web-animations-next/src/apply.js +0 -25
- data/app/assets/components/web-animations-next/src/box-handler.js +0 -57
- data/app/assets/components/web-animations-next/src/color-handler.js +0 -62
- data/app/assets/components/web-animations-next/src/deprecation.js +0 -42
- data/app/assets/components/web-animations-next/src/dev.js +0 -16
- data/app/assets/components/web-animations-next/src/dimension-handler.js +0 -167
- data/app/assets/components/web-animations-next/src/effect-callback.js +0 -86
- data/app/assets/components/web-animations-next/src/effect.js +0 -110
- data/app/assets/components/web-animations-next/src/element-animatable.js +0 -19
- data/app/assets/components/web-animations-next/src/font-weight-handler.js +0 -42
- data/app/assets/components/web-animations-next/src/group-constructors.js +0 -81
- data/app/assets/components/web-animations-next/src/handler-utils.js +0 -177
- data/app/assets/components/web-animations-next/src/interpolation.js +0 -49
- data/app/assets/components/web-animations-next/src/matrix-decomposition.js +0 -452
- data/app/assets/components/web-animations-next/src/matrix-interpolation.js +0 -130
- data/app/assets/components/web-animations-next/src/maxifill-player.js +0 -162
- data/app/assets/components/web-animations-next/src/normalize-keyframes.js +0 -259
- data/app/assets/components/web-animations-next/src/number-handler.js +0 -72
- data/app/assets/components/web-animations-next/src/player.js +0 -193
- data/app/assets/components/web-animations-next/src/position-handler.js +0 -117
- data/app/assets/components/web-animations-next/src/property-interpolation.js +0 -62
- data/app/assets/components/web-animations-next/src/property-names.js +0 -35
- data/app/assets/components/web-animations-next/src/scope.js +0 -20
- data/app/assets/components/web-animations-next/src/shadow-handler.js +0 -108
- data/app/assets/components/web-animations-next/src/shape-handler.js +0 -85
- data/app/assets/components/web-animations-next/src/tick.js +0 -148
- data/app/assets/components/web-animations-next/src/timeline.js +0 -77
- data/app/assets/components/web-animations-next/src/timing-utilities.js +0 -242
- data/app/assets/components/web-animations-next/src/transform-handler.js +0 -262
- data/app/assets/components/web-animations-next/src/visibility-handler.js +0 -29
- data/app/assets/components/web-animations-next/target-config.js +0 -124
- data/app/assets/components/web-animations-next/target-loader.js +0 -13
- data/app/assets/components/web-animations-next/templates/boilerplate +0 -13
- data/app/assets/components/web-animations-next/templates/runner.html +0 -26
- data/app/assets/components/web-animations-next/templates/web-animations.html +0 -18
- data/app/assets/components/web-animations-next/templates/web-animations.js +0 -21
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.html +0 -44
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.js +0 -21
- data/app/assets/components/web-animations-next/web-animations-next.dev.html +0 -49
- data/app/assets/components/web-animations-next/web-animations-next.dev.js +0 -21
- data/app/assets/components/web-animations-next/web-animations.dev.html +0 -44
- data/app/assets/components/web-animations-next/web-animations.dev.js +0 -21
- data/app/assets/components/web-animations-next/web-animations.html +0 -50
@@ -1,153 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<!--
|
3
|
-
Copyright (c) 2014 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
|
-
<html>
|
11
|
-
<head>
|
12
|
-
<title>core-overlay</title>
|
13
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
14
|
-
<script src="../../../webcomponentsjs/webcomponents.js"></script>
|
15
|
-
<script src="../../../polymer-test-tools/chai/chai.js"></script>
|
16
|
-
<script src="../../../polymer-test-tools/htmltest.js"></script>
|
17
|
-
<link rel="import" href="../../../core-transition/core-transition-css.html">
|
18
|
-
<link rel="import" href="../../core-overlay.html">
|
19
|
-
<style>
|
20
|
-
body {
|
21
|
-
margin: 0;
|
22
|
-
height: 100%;
|
23
|
-
}
|
24
|
-
|
25
|
-
.sized {
|
26
|
-
height: 200px;
|
27
|
-
width: 300px;
|
28
|
-
border: 1px solid black;
|
29
|
-
padding: 10px;
|
30
|
-
margin: 16px;
|
31
|
-
}
|
32
|
-
|
33
|
-
.positioned {
|
34
|
-
top: 0;
|
35
|
-
left: 0;
|
36
|
-
}
|
37
|
-
</style>
|
38
|
-
</head>
|
39
|
-
<body unresolved>
|
40
|
-
|
41
|
-
<core-overlay class="sized" id="basic">
|
42
|
-
Sized Overlay
|
43
|
-
</core-overlay>
|
44
|
-
|
45
|
-
<core-overlay class="sized positioned" id="overlay">
|
46
|
-
Positioned Overlay
|
47
|
-
</core-overlay>
|
48
|
-
|
49
|
-
<template>
|
50
|
-
<div>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</div>
|
51
|
-
</template>
|
52
|
-
|
53
|
-
<script>
|
54
|
-
document.addEventListener('polymer-ready', function() {
|
55
|
-
// setup
|
56
|
-
var basic = document.querySelector('#basic');
|
57
|
-
var overlay = document.querySelector('#overlay');
|
58
|
-
var template = document.querySelector('template');
|
59
|
-
|
60
|
-
function testWhenOpen(element, test, next) {
|
61
|
-
var l1 = function() {
|
62
|
-
test();
|
63
|
-
element.async(function() {
|
64
|
-
element.opened = false;
|
65
|
-
}, 1);
|
66
|
-
};
|
67
|
-
var l2 = function() {
|
68
|
-
element.removeEventListener('core-overlay-open-completed', l1);
|
69
|
-
element.removeEventListener('core-overlay-close-completed', l2);
|
70
|
-
next();
|
71
|
-
};
|
72
|
-
element.addEventListener('core-overlay-open-completed', l1);
|
73
|
-
element.addEventListener('core-overlay-close-completed', l2);
|
74
|
-
element.opened = true;
|
75
|
-
}
|
76
|
-
|
77
|
-
asyncSeries([
|
78
|
-
// centered overlay
|
79
|
-
function(next) {
|
80
|
-
testWhenOpen(basic, function() {
|
81
|
-
var rect = basic.getBoundingClientRect();
|
82
|
-
chai.assert.ok(Math.abs(rect.left - (window.innerWidth - rect.right)) < 5, 'overlay centered horizontally');
|
83
|
-
chai.assert.ok(Math.abs(rect.top - (window.innerHeight - rect.bottom)) < 5, 'overlay centered vertically');
|
84
|
-
}, next);
|
85
|
-
},
|
86
|
-
// css positioned overlay
|
87
|
-
function(next) {
|
88
|
-
testWhenOpen(overlay, function() {
|
89
|
-
var rect = overlay.getBoundingClientRect();
|
90
|
-
chai.assert.equal(rect.left, 16, 'positions via css');
|
91
|
-
chai.assert.equal(rect.top, 16, 'positions via css');
|
92
|
-
}, next);
|
93
|
-
},
|
94
|
-
// manual positioned overlay
|
95
|
-
function(next) {
|
96
|
-
overlay.style.left = overlay.style.top = 'auto';
|
97
|
-
overlay.style.right = '0px';
|
98
|
-
testWhenOpen(overlay, function() {
|
99
|
-
var rect = overlay.getBoundingClientRect();
|
100
|
-
chai.assert.equal(rect.right, window.innerWidth - 16, 'positioned manually');
|
101
|
-
chai.assert.ok(Math.abs(rect.top - (window.innerHeight - rect.bottom)) <= 16, 'overlay centered vertically');
|
102
|
-
}, next);
|
103
|
-
},
|
104
|
-
// overflow, position top, left
|
105
|
-
function(next) {
|
106
|
-
overlay.style.left = overlay.style.top = '0px';
|
107
|
-
overlay.style.right = 'auto';
|
108
|
-
overlay.style.width = overlay.style.height = 'auto';
|
109
|
-
for (var i=0; i<20; i++) {
|
110
|
-
overlay.appendChild(template.content.cloneNode(true));
|
111
|
-
}
|
112
|
-
testWhenOpen(overlay, function() {
|
113
|
-
var rect = overlay.getBoundingClientRect();
|
114
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
115
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
116
|
-
}, next);
|
117
|
-
},
|
118
|
-
// overflow, position, bottom, right
|
119
|
-
function(next) {
|
120
|
-
overlay.style.right = overlay.style.bottom = '0px';
|
121
|
-
overlay.style.left = overlay.style.top = 'auto';
|
122
|
-
testWhenOpen(overlay, function() {
|
123
|
-
var rect = overlay.getBoundingClientRect();
|
124
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
125
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
126
|
-
}, next);
|
127
|
-
},
|
128
|
-
// overflow, unpositioned
|
129
|
-
function(next) {
|
130
|
-
overlay.style.right = overlay.style.bottom = 'auto';
|
131
|
-
overlay.style.left = overlay.style.top = 'auto';
|
132
|
-
testWhenOpen(overlay, function() {
|
133
|
-
var rect = overlay.getBoundingClientRect();
|
134
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
135
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
136
|
-
}, next);
|
137
|
-
},
|
138
|
-
// overflow, unpositioned, layered
|
139
|
-
function(next) {
|
140
|
-
overlay.layered = true;
|
141
|
-
testWhenOpen(overlay, function() {
|
142
|
-
var rect = overlay.getBoundingClientRect();
|
143
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
144
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
145
|
-
}, next);
|
146
|
-
},
|
147
|
-
], done);
|
148
|
-
});
|
149
|
-
|
150
|
-
</script>
|
151
|
-
|
152
|
-
</body>
|
153
|
-
</html>
|
@@ -1,167 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<!--
|
3
|
-
Copyright (c) 2014 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
|
-
<html>
|
11
|
-
<head>
|
12
|
-
<title>core-overlay</title>
|
13
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
14
|
-
<script src="../../../webcomponentsjs/webcomponents.js"></script>
|
15
|
-
<script src="../../../polymer-test-tools/chai/chai.js"></script>
|
16
|
-
<script src="../../../polymer-test-tools/htmltest.js"></script>
|
17
|
-
<link rel="import" href="../../../core-transition/core-transition-css.html">
|
18
|
-
<link rel="import" href="../../core-overlay.html">
|
19
|
-
<style>
|
20
|
-
body {
|
21
|
-
margin: 0;
|
22
|
-
height: 100%;
|
23
|
-
}
|
24
|
-
|
25
|
-
.sized {
|
26
|
-
height: 200px;
|
27
|
-
width: 300px;
|
28
|
-
border: 1px solid black;
|
29
|
-
padding: 10px;
|
30
|
-
}
|
31
|
-
|
32
|
-
.positioned {
|
33
|
-
top: 0;
|
34
|
-
left: 0;
|
35
|
-
}
|
36
|
-
</style>
|
37
|
-
</head>
|
38
|
-
<body unresolved>
|
39
|
-
|
40
|
-
<core-overlay class="sized" id="basic">
|
41
|
-
Sized Overlay
|
42
|
-
</core-overlay>
|
43
|
-
|
44
|
-
<core-overlay class="sized positioned" id="overlay">
|
45
|
-
Positioned Overlay
|
46
|
-
</core-overlay>
|
47
|
-
|
48
|
-
<template>
|
49
|
-
<div>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</div>
|
50
|
-
</template>
|
51
|
-
|
52
|
-
<script>
|
53
|
-
document.addEventListener('polymer-ready', function() {
|
54
|
-
// setup
|
55
|
-
var basic = document.querySelector('#basic');
|
56
|
-
var overlay = document.querySelector('#overlay');
|
57
|
-
var template = document.querySelector('template');
|
58
|
-
|
59
|
-
function testWhenOpen(element, test, next) {
|
60
|
-
var l1 = function() {
|
61
|
-
test();
|
62
|
-
element.async(function() {
|
63
|
-
element.opened = false;
|
64
|
-
}, 1);
|
65
|
-
};
|
66
|
-
var l2 = function() {
|
67
|
-
element.removeEventListener('core-overlay-open-completed', l1);
|
68
|
-
element.removeEventListener('core-overlay-close-completed', l2);
|
69
|
-
next();
|
70
|
-
};
|
71
|
-
element.addEventListener('core-overlay-open-completed', l1);
|
72
|
-
element.addEventListener('core-overlay-close-completed', l2);
|
73
|
-
element.opened = true;
|
74
|
-
}
|
75
|
-
|
76
|
-
asyncSeries([
|
77
|
-
// centered overlay
|
78
|
-
function(next) {
|
79
|
-
testWhenOpen(basic, function() {
|
80
|
-
var rect = basic.getBoundingClientRect();
|
81
|
-
chai.assert.ok(Math.abs(rect.left - (window.innerWidth - rect.right)) < 5, 'overlay centered horizontally');
|
82
|
-
chai.assert.ok(Math.abs(rect.top - (window.innerHeight - rect.bottom)) < 5, 'overlay centered vertically');
|
83
|
-
}, next);
|
84
|
-
},
|
85
|
-
// does not retain positioning when centered and re-opened
|
86
|
-
function(next) {
|
87
|
-
var listener = function(e) {
|
88
|
-
var dimensions = e.target.dimensions;
|
89
|
-
chai.assert.equal(dimensions.position.h, undefined);
|
90
|
-
chai.assert.equal(dimensions.position.v, undefined);
|
91
|
-
};
|
92
|
-
basic.addEventListener('core-overlay-open-completed', listener, false);
|
93
|
-
testWhenOpen(basic, function() {
|
94
|
-
var rect = basic.getBoundingClientRect();
|
95
|
-
chai.assert.ok(Math.abs(rect.left - (window.innerWidth - rect.right)) < 5, 'overlay centered horizontally');
|
96
|
-
chai.assert.ok(Math.abs(rect.top - (window.innerHeight - rect.bottom)) < 5, 'overlay centered vertically');
|
97
|
-
basic.removeEventListener('core-overlay-open-completed', listener, false);
|
98
|
-
}, next);
|
99
|
-
},
|
100
|
-
// css positioned overlay
|
101
|
-
function(next) {
|
102
|
-
testWhenOpen(overlay, function() {
|
103
|
-
var rect = overlay.getBoundingClientRect();
|
104
|
-
chai.assert.equal(rect.left, 0, 'positions via css');
|
105
|
-
chai.assert.equal(rect.top, 0, 'positions via css');
|
106
|
-
}, next);
|
107
|
-
},
|
108
|
-
// manual positioned overlay
|
109
|
-
function(next) {
|
110
|
-
overlay.style.left = overlay.style.top = 'auto';
|
111
|
-
overlay.style.right = '0px';
|
112
|
-
testWhenOpen(overlay, function() {
|
113
|
-
var rect = overlay.getBoundingClientRect();
|
114
|
-
chai.assert.equal(rect.right, window.innerWidth, 'positioned manually');
|
115
|
-
chai.assert.ok(Math.abs(rect.top - (window.innerHeight - rect.bottom)) < 5, 'overlay centered vertically');
|
116
|
-
}, next);
|
117
|
-
},
|
118
|
-
// overflow, position top, left
|
119
|
-
function(next) {
|
120
|
-
overlay.style.left = overlay.style.top = '0px';
|
121
|
-
overlay.style.right = 'auto';
|
122
|
-
overlay.style.width = overlay.style.height = 'auto';
|
123
|
-
for (var i=0; i<20; i++) {
|
124
|
-
overlay.appendChild(template.content.cloneNode(true));
|
125
|
-
}
|
126
|
-
testWhenOpen(overlay, function() {
|
127
|
-
var rect = overlay.getBoundingClientRect();
|
128
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
129
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
130
|
-
}, next);
|
131
|
-
},
|
132
|
-
// overflow, position, bottom, right
|
133
|
-
function(next) {
|
134
|
-
overlay.style.right = overlay.style.bottom = '0px';
|
135
|
-
overlay.style.left = overlay.style.top = 'auto';
|
136
|
-
testWhenOpen(overlay, function() {
|
137
|
-
var rect = overlay.getBoundingClientRect();
|
138
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
139
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
140
|
-
}, next);
|
141
|
-
},
|
142
|
-
// overflow, unpositioned
|
143
|
-
function(next) {
|
144
|
-
overlay.style.right = overlay.style.bottom = 'auto';
|
145
|
-
overlay.style.left = overlay.style.top = 'auto';
|
146
|
-
testWhenOpen(overlay, function() {
|
147
|
-
var rect = overlay.getBoundingClientRect();
|
148
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
149
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
150
|
-
}, next);
|
151
|
-
},
|
152
|
-
// overflow, unpositioned, layered
|
153
|
-
function(next) {
|
154
|
-
overlay.layered = true;
|
155
|
-
testWhenOpen(overlay, function() {
|
156
|
-
var rect = overlay.getBoundingClientRect();
|
157
|
-
chai.assert.ok(window.innerWidth >= rect.right, 'overlay constrained to window size');
|
158
|
-
chai.assert.ok(window.innerHeight >= rect.bottom, 'overlay constrained to window size');
|
159
|
-
}, next);
|
160
|
-
},
|
161
|
-
], done);
|
162
|
-
});
|
163
|
-
|
164
|
-
</script>
|
165
|
-
|
166
|
-
</body>
|
167
|
-
</html>
|
@@ -1,130 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<!--
|
3
|
-
Copyright (c) 2014 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
|
-
<html>
|
11
|
-
<head>
|
12
|
-
<title>core-overlay</title>
|
13
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
14
|
-
<script src="../../../webcomponentsjs/webcomponents.js"></script>
|
15
|
-
<script src="../../../polymer-test-tools/chai/chai.js"></script>
|
16
|
-
<script src="../../../polymer-test-tools/htmltest.js"></script>
|
17
|
-
<link rel="import" href="../../../core-transition/core-transition-css.html">
|
18
|
-
<link rel="import" href="../../core-overlay.html">
|
19
|
-
<style>
|
20
|
-
core-overlay {
|
21
|
-
width: 300px;
|
22
|
-
border: 1px solid black;
|
23
|
-
margin: 10px;
|
24
|
-
overflow: auto !important;
|
25
|
-
}
|
26
|
-
|
27
|
-
#content {
|
28
|
-
overflow: auto;
|
29
|
-
}
|
30
|
-
</style>
|
31
|
-
</head>
|
32
|
-
<body fullbleed unresolved>
|
33
|
-
<template is="auto-binding">
|
34
|
-
<core-overlay id="simple">
|
35
|
-
<div>Lots of Content that might overflow the overlay!</div>
|
36
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
37
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
38
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
39
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
40
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
41
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
42
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
43
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
44
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
45
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
46
|
-
</core-overlay>
|
47
|
-
|
48
|
-
<core-overlay id="sectioned" vertical layout sizingTarget="{{$.content}}">
|
49
|
-
<header>Stuff on top</header>
|
50
|
-
<section id="content">
|
51
|
-
<div>Lots of Content that might overflow the overlay!</div>
|
52
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
53
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
54
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
55
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
56
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
57
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
58
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
59
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
60
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
61
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
62
|
-
</section>
|
63
|
-
<footer>Stuff on bottom</footer>
|
64
|
-
</core-overlay>
|
65
|
-
</template>
|
66
|
-
<script>
|
67
|
-
addEventListener('template-bound', function(e) {
|
68
|
-
// setup
|
69
|
-
var simple = document.querySelector('#simple');
|
70
|
-
var sectioned = document.querySelector('#sectioned');
|
71
|
-
|
72
|
-
function testWhenOpen(element, test, next) {
|
73
|
-
var l1 = function() {
|
74
|
-
test();
|
75
|
-
element.async(function() {
|
76
|
-
element.opened = false;
|
77
|
-
}, null, 1);
|
78
|
-
};
|
79
|
-
var l2 = function() {
|
80
|
-
element.removeEventListener('core-overlay-open-completed', l1);
|
81
|
-
element.removeEventListener('core-overlay-close-completed', l2);
|
82
|
-
next();
|
83
|
-
};
|
84
|
-
element.addEventListener('core-overlay-open-completed', l1);
|
85
|
-
element.addEventListener('core-overlay-close-completed', l2);
|
86
|
-
element.opened = true;
|
87
|
-
}
|
88
|
-
|
89
|
-
asyncSeries([
|
90
|
-
// scrolling overlay does not overflow
|
91
|
-
function(next) {
|
92
|
-
testWhenOpen(simple, function() {
|
93
|
-
var rect = simple.getBoundingClientRect();
|
94
|
-
chai.assert.ok(0 < rect.top + 10, 'overlay constrained to window size');
|
95
|
-
chai.assert.ok(0 < rect.left + 10, 'overlay constrained to window size');
|
96
|
-
chai.assert.ok(window.innerWidth >= rect.right + 10, 'overlay constrained to window size');
|
97
|
-
chai.assert.ok(window.innerHeight >= rect.bottom + 10, 'overlay constrained to window size');
|
98
|
-
}, next);
|
99
|
-
},
|
100
|
-
// scrolling overlay does not overflow
|
101
|
-
function(next) {
|
102
|
-
testWhenOpen(sectioned, function() {
|
103
|
-
var rect = sectioned.getBoundingClientRect();
|
104
|
-
chai.assert.ok(0 < rect.top + 10, 'overlay constrained to window size');
|
105
|
-
chai.assert.ok(0 < rect.left + 10, 'overlay constrained to window size');
|
106
|
-
chai.assert.ok(window.innerWidth >= rect.right + 10, 'overlay constrained to window size');
|
107
|
-
chai.assert.ok(window.innerHeight >= rect.bottom + 10, 'overlay constrained to window size');
|
108
|
-
}, next);
|
109
|
-
},
|
110
|
-
// positioned scrolling overlay does not overflow
|
111
|
-
function(next) {
|
112
|
-
sectioned.style.top = sectioned.style.right = '';
|
113
|
-
sectioned.style.left = '300px';
|
114
|
-
sectioned.style.bottom = '200px'
|
115
|
-
testWhenOpen(sectioned, function() {
|
116
|
-
var rect = sectioned.getBoundingClientRect();
|
117
|
-
chai.assert.ok(0 < rect.top + 10, 'overlay constrained to window size');
|
118
|
-
chai.assert.ok(0 < rect.left + 10, 'overlay constrained to window size');
|
119
|
-
chai.assert.ok(window.innerWidth >= rect.right + 10, 'overlay constrained to window size');
|
120
|
-
chai.assert.ok(window.innerHeight >= rect.bottom + 10, 'overlay constrained to window size');
|
121
|
-
}, next);
|
122
|
-
}
|
123
|
-
], done);
|
124
|
-
});
|
125
|
-
</script>
|
126
|
-
</body>
|
127
|
-
|
128
|
-
</html>
|
129
|
-
|
130
|
-
</html>
|