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,14 +0,0 @@
|
|
1
|
-
<!doctype htmlz>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
6
|
-
<title>Web Component Test Runner</title>
|
7
|
-
<script src="../../polymer-test-tools/ci-support.js"></script>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
<script>
|
11
|
-
runTests('tests.json');
|
12
|
-
</script>
|
13
|
-
</body>
|
14
|
-
</html>
|
@@ -1,28 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
-
Code distributed by Google as part of the polymer project is also
|
7
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
-
*/
|
9
|
-
|
10
|
-
:host {
|
11
|
-
display: block;
|
12
|
-
border-radius: 3px;
|
13
|
-
background-color: #fff;
|
14
|
-
color: #000;
|
15
|
-
max-height: inherit;
|
16
|
-
}
|
17
|
-
|
18
|
-
#menu {
|
19
|
-
max-height: inherit;
|
20
|
-
overflow: scroll;
|
21
|
-
-webkit-overflow-scrolling: touch;
|
22
|
-
margin: 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
polyfill-next-selector { content: ':host > .core-selected'; }
|
26
|
-
::content .core-selected {
|
27
|
-
background-color: #eee;
|
28
|
-
}
|
@@ -1,198 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
-
Code distributed by Google as part of the polymer project is also
|
7
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
-
-->
|
9
|
-
|
10
|
-
<!--
|
11
|
-
|
12
|
-
`core-popup-menu` is a popup menu that can be positioned relative to another
|
13
|
-
element, usually the element that opens or closes the menu. It can be used
|
14
|
-
to implement drop-downs, menu buttons, etc..
|
15
|
-
|
16
|
-
Example:
|
17
|
-
|
18
|
-
<template is="auto-binding">
|
19
|
-
<div id="control">Your favorite pastry:</div>
|
20
|
-
<core-popup-menu relatedTarget="{{$.control}}" on-core-select="{{selectAction}}">
|
21
|
-
<core-item label="Churro"></core-item>
|
22
|
-
<core-item label="Donut"></core-item>
|
23
|
-
<core-item label="Macaron"></core-item>
|
24
|
-
</core-popup-menu>
|
25
|
-
</template>
|
26
|
-
|
27
|
-
@group Polymer Core Elements
|
28
|
-
@element core-popup-menu
|
29
|
-
@homepage github.io
|
30
|
-
-->
|
31
|
-
|
32
|
-
<!--
|
33
|
-
Fired when an item's selection state is changed. This event is fired both
|
34
|
-
when an item is selected or deselected. The `isSelected` detail property
|
35
|
-
contains the selection state.
|
36
|
-
|
37
|
-
@event core-select
|
38
|
-
@param {Object} detail
|
39
|
-
@param {boolean} detail.isSelected true for selection and false for de-selection
|
40
|
-
@param {Object} detail.item the item element
|
41
|
-
-->
|
42
|
-
<link href="../polymer/polymer.html" rel="import">
|
43
|
-
<link href="../core-menu/core-menu.html" rel="import">
|
44
|
-
|
45
|
-
<link href="core-popup-overlay.html" rel="import">
|
46
|
-
|
47
|
-
<polymer-element name="core-popup-menu">
|
48
|
-
<template>
|
49
|
-
|
50
|
-
<link href="core-popup-menu.css" rel="stylesheet">
|
51
|
-
|
52
|
-
<core-popup-overlay id="overlay" target="{{}}" sizingTarget="{{$.menu}}" relatedTarget="{{relatedTarget}}" opened="{{opened}}" halign="{{halign}}" valign="{{valign}}" transition="{{transition}}"></core-popup-overlay>
|
53
|
-
|
54
|
-
<core-menu id="menu" selected="{{selected}}" valueattr="{{valueattr}}" selectedClass="{{selectedClass}}" selectedProperty="{{selectedProperty}}" selectedAttribute="{{selectedAttribute}}" selectedItem="{{selectedItem}}" selectedModel="{{selectedModel}}" selectedIndex="{{selectedIndex}}" on-core-select="{{selectAction}}">
|
55
|
-
<content></content>
|
56
|
-
</core-menu>
|
57
|
-
|
58
|
-
</template>
|
59
|
-
<script>
|
60
|
-
|
61
|
-
Polymer({
|
62
|
-
|
63
|
-
publish: {
|
64
|
-
|
65
|
-
/**
|
66
|
-
* The element associated with this menu, usually the element that
|
67
|
-
* causes the menu the open.
|
68
|
-
*
|
69
|
-
* @attribute relatedTarget
|
70
|
-
* @type Node
|
71
|
-
*/
|
72
|
-
relatedTarget: null,
|
73
|
-
|
74
|
-
/**
|
75
|
-
* If true, the menu is currently visible.
|
76
|
-
*
|
77
|
-
* @attribute opened
|
78
|
-
* @type boolean
|
79
|
-
* @default false
|
80
|
-
*/
|
81
|
-
opened: false,
|
82
|
-
|
83
|
-
/**
|
84
|
-
* The horizontal alignment of the pulldown menu relative to the button.
|
85
|
-
*
|
86
|
-
* @attribute halign
|
87
|
-
* @type 'left' | 'right' | 'auto'
|
88
|
-
* @default 'auto'
|
89
|
-
*/
|
90
|
-
halign: { value: 'auto', reflect: true },
|
91
|
-
|
92
|
-
/**
|
93
|
-
* The vertical alignment of the pulldown menu relative to the button.
|
94
|
-
*
|
95
|
-
* @attribute valign
|
96
|
-
* @type 'bottom' | 'top' | 'auto'
|
97
|
-
* @default 'auto'
|
98
|
-
*/
|
99
|
-
valign: { value: 'auto', reflect: true },
|
100
|
-
|
101
|
-
/**
|
102
|
-
* The transition property specifies a string which identifies a
|
103
|
-
* <a href="../core-transition/">`core-transition`</a> element that
|
104
|
-
* will be used to help the overlay open and close. The default
|
105
|
-
* `core-transition-fade` will cause the overlay to fade in and out.
|
106
|
-
*
|
107
|
-
* @attribute transition
|
108
|
-
* @type string
|
109
|
-
* @default 'core-transition-fade'
|
110
|
-
*/
|
111
|
-
transition: null,
|
112
|
-
|
113
|
-
/**
|
114
|
-
* Gets or sets the selected element. Default to use the index
|
115
|
-
* of the item element.
|
116
|
-
*
|
117
|
-
* @attribute selected
|
118
|
-
* @type Object
|
119
|
-
* @default null
|
120
|
-
*/
|
121
|
-
selected: null,
|
122
|
-
|
123
|
-
/**
|
124
|
-
* Specifies the attribute to be used for "selected" attribute.
|
125
|
-
*
|
126
|
-
* @attribute valueattr
|
127
|
-
* @type string
|
128
|
-
* @default 'name'
|
129
|
-
*/
|
130
|
-
valueattr: 'name',
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Specifies the CSS class to be used to add to the selected element.
|
134
|
-
*
|
135
|
-
* @attribute selectedClass
|
136
|
-
* @type string
|
137
|
-
* @default 'core-selected'
|
138
|
-
*/
|
139
|
-
selectedClass: 'core-selected',
|
140
|
-
|
141
|
-
/**
|
142
|
-
* Specifies the property to be used to set on the selected element
|
143
|
-
* to indicate its active state.
|
144
|
-
*
|
145
|
-
* @attribute selectedProperty
|
146
|
-
* @type string
|
147
|
-
* @default ''
|
148
|
-
*/
|
149
|
-
selectedProperty: '',
|
150
|
-
|
151
|
-
/**
|
152
|
-
* Specifies the attribute to set on the selected element to indicate
|
153
|
-
* its active state.
|
154
|
-
*
|
155
|
-
* @attribute selectedAttribute
|
156
|
-
* @type string
|
157
|
-
* @default 'active'
|
158
|
-
*/
|
159
|
-
selectedAttribute: 'active',
|
160
|
-
|
161
|
-
/**
|
162
|
-
* Returns the currently selected element.
|
163
|
-
*
|
164
|
-
* @attribute selectedItem
|
165
|
-
* @type Object
|
166
|
-
* @default null
|
167
|
-
*/
|
168
|
-
selectedItem: null,
|
169
|
-
|
170
|
-
/**
|
171
|
-
* In single selection, this returns the model associated with the
|
172
|
-
* selected element.
|
173
|
-
*
|
174
|
-
* @attribute selectedModel
|
175
|
-
* @type Object
|
176
|
-
* @default null
|
177
|
-
*/
|
178
|
-
selectedModel: null,
|
179
|
-
|
180
|
-
/**
|
181
|
-
* In single selection, this returns the selected index.
|
182
|
-
*
|
183
|
-
* @attribute selectedIndex
|
184
|
-
* @type number
|
185
|
-
* @default -1
|
186
|
-
*/
|
187
|
-
selectedIndex: -1
|
188
|
-
|
189
|
-
},
|
190
|
-
|
191
|
-
selectAction: function() {
|
192
|
-
this.opened = false;
|
193
|
-
}
|
194
|
-
|
195
|
-
});
|
196
|
-
|
197
|
-
</script>
|
198
|
-
</polymer-element>
|
@@ -1,111 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
-
Code distributed by Google as part of the polymer project is also
|
7
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
-
-->
|
9
|
-
|
10
|
-
<link rel="import" href="../polymer/polymer.html">
|
11
|
-
<link rel="import" href="../core-overlay/core-overlay.html">
|
12
|
-
|
13
|
-
<!--
|
14
|
-
|
15
|
-
`core-popup-overlay` is a helper class to position an overlay relative to another
|
16
|
-
element.
|
17
|
-
|
18
|
-
@group Polymer Core Elements
|
19
|
-
@element core-popup-overlay
|
20
|
-
@extends core-overlay
|
21
|
-
@homepage github.io
|
22
|
-
-->
|
23
|
-
|
24
|
-
<polymer-element name="core-popup-overlay" extends="core-overlay">
|
25
|
-
<script>
|
26
|
-
Polymer({
|
27
|
-
|
28
|
-
publish: {
|
29
|
-
|
30
|
-
/**
|
31
|
-
* The `relatedTarget` is an element used to position the overlay, for example a
|
32
|
-
* button the user taps to show a menu.
|
33
|
-
*
|
34
|
-
* @attribute relatedTarget
|
35
|
-
* @type Element
|
36
|
-
*/
|
37
|
-
relatedTarget: null,
|
38
|
-
|
39
|
-
/**
|
40
|
-
* The horizontal alignment of the overlay relative to the `relatedTarget`.
|
41
|
-
*
|
42
|
-
* @attribute halign
|
43
|
-
* @type 'left'|'right'|'auto'
|
44
|
-
* @default 'auto'
|
45
|
-
*/
|
46
|
-
halign: 'auto',
|
47
|
-
|
48
|
-
/**
|
49
|
-
* The vertical alignment of the overlay relative to the `relatedTarget`.
|
50
|
-
*
|
51
|
-
* @attribute valign
|
52
|
-
* @type 'top'|'bottom'|'auto'
|
53
|
-
* @default 'bottom'
|
54
|
-
*/
|
55
|
-
valign: 'auto',
|
56
|
-
|
57
|
-
margin: 12
|
58
|
-
|
59
|
-
},
|
60
|
-
|
61
|
-
positionTarget: function() {
|
62
|
-
if (!this.relatedTarget) {
|
63
|
-
this.super();
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
|
67
|
-
var top, left, bottom, right;
|
68
|
-
var ref = this.relatedTarget.getBoundingClientRect();
|
69
|
-
|
70
|
-
if (this.halign === 'left') {
|
71
|
-
left = ref.left;
|
72
|
-
} else if (this.halign === 'right') {
|
73
|
-
right = window.innerWidth - ref.right;
|
74
|
-
} else if (this.halign === 'auto') {
|
75
|
-
if (ref.left + this.target.offsetWidth > window.innerWidth) {
|
76
|
-
right = window.innerWidth - ref.right;
|
77
|
-
} else {
|
78
|
-
left = ref.left;
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
if (this.valign === 'top') {
|
83
|
-
bottom = window.innerHeight - ref.bottom;
|
84
|
-
} else if (this.valign === 'bottom') {
|
85
|
-
top = ref.top;
|
86
|
-
} else if (this.valign === 'auto') {
|
87
|
-
if (ref.top + this.target.offsetHeight > window.innerHeight && this.target.offsetHeight < window.innerHeight) {
|
88
|
-
bottom = window.innerHeight - ref.bottom;
|
89
|
-
} else {
|
90
|
-
top = ref.top;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
(top !== undefined) && (this.target.style.top = top + 'px');
|
95
|
-
(left !== undefined) && (this.target.style.left = left + 'px');
|
96
|
-
(bottom !== undefined) && (this.target.style.bottom = bottom + 'px');
|
97
|
-
(right !== undefined) && (this.target.style.right = right + 'px');
|
98
|
-
},
|
99
|
-
|
100
|
-
sizeTarget: function() {
|
101
|
-
var rect = this.relatedTarget.getBoundingClientRect();
|
102
|
-
var sizer = this.sizingTarget || this.target;
|
103
|
-
|
104
|
-
sizer.style.minWidth = rect.width + 'px';
|
105
|
-
|
106
|
-
this.super();
|
107
|
-
}
|
108
|
-
|
109
|
-
});
|
110
|
-
</script>
|
111
|
-
</polymer-element>
|
@@ -1,62 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@license
|
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
|
-
<x-meta id="core-menu" label="Menu" group="Core" isContainer>
|
11
|
-
|
12
|
-
<template>
|
13
|
-
|
14
|
-
<core-menu selected="0" style="font-size: 16px;">
|
15
|
-
|
16
|
-
<core-submenu icon="settings" label="Topics">
|
17
|
-
|
18
|
-
<core-item label="Topic 1"></core-item>
|
19
|
-
<core-item label="Topic 2"></core-item>
|
20
|
-
|
21
|
-
</core-submenu>
|
22
|
-
|
23
|
-
<core-submenu icon="settings" label="Favorites">
|
24
|
-
|
25
|
-
<core-item label="Favorite 1"></core-item>
|
26
|
-
<core-item label="Favorite 2"></core-item>
|
27
|
-
<core-item label="Favorite 3"></core-item>
|
28
|
-
|
29
|
-
</core-submenu>
|
30
|
-
|
31
|
-
</core-menu>
|
32
|
-
|
33
|
-
</template>
|
34
|
-
|
35
|
-
<template id="imports">
|
36
|
-
|
37
|
-
<link rel="import" href="core-submenu.html">
|
38
|
-
|
39
|
-
</template>
|
40
|
-
|
41
|
-
</x-meta>
|
42
|
-
|
43
|
-
<x-meta id="core-submenu" label="Sub Menu" group="Core" isContainer>
|
44
|
-
|
45
|
-
<template>
|
46
|
-
|
47
|
-
<core-submenu icon="settings" label="Topics">
|
48
|
-
|
49
|
-
<core-item label="Topic 1"></core-item>
|
50
|
-
<core-item label="Topic 2"></core-item>
|
51
|
-
|
52
|
-
</core-submenu>
|
53
|
-
|
54
|
-
</template>
|
55
|
-
|
56
|
-
<template id="imports">
|
57
|
-
|
58
|
-
<link rel="import" href="core-submenu.html">
|
59
|
-
|
60
|
-
</template>
|
61
|
-
|
62
|
-
</x-meta>
|
@@ -1,146 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
-
Code distributed by Google as part of the polymer project is also
|
7
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
-
-->
|
9
|
-
|
10
|
-
<!--
|
11
|
-
/**
|
12
|
-
* @group Paper Elements
|
13
|
-
*
|
14
|
-
* paper-focusable is a base class for paper elements that can be focused.
|
15
|
-
*
|
16
|
-
* @element paper-focusable
|
17
|
-
* @status beta
|
18
|
-
* @homepage github.io
|
19
|
-
*/
|
20
|
-
-->
|
21
|
-
|
22
|
-
<link href="../polymer/polymer.html" rel="import">
|
23
|
-
|
24
|
-
<polymer-element name="paper-focusable" attributes="active focused disabled isToggle" tabindex="0" on-down="{{downAction}}" on-up="{{upAction}}" on-focus="{{focusAction}}" on-blur="{{blurAction}}" on-contextmenu="{{contextMenuAction}}">
|
25
|
-
|
26
|
-
<template>
|
27
|
-
<style>
|
28
|
-
:host([disabled]) {
|
29
|
-
pointer-events: none;
|
30
|
-
}
|
31
|
-
</style>
|
32
|
-
<content></content>
|
33
|
-
</template>
|
34
|
-
|
35
|
-
<script>
|
36
|
-
Polymer('paper-focusable', {
|
37
|
-
|
38
|
-
publish: {
|
39
|
-
|
40
|
-
/**
|
41
|
-
* If true, the button is currently active either because the
|
42
|
-
* user is holding down the button, or the button is a toggle
|
43
|
-
* and is currently in the active state.
|
44
|
-
*
|
45
|
-
* @attribute active
|
46
|
-
* @type boolean
|
47
|
-
* @default false
|
48
|
-
*/
|
49
|
-
active: {value: false, reflect: true},
|
50
|
-
|
51
|
-
/**
|
52
|
-
* If true, the element currently has focus due to keyboard
|
53
|
-
* navigation.
|
54
|
-
*
|
55
|
-
* @attribute focused
|
56
|
-
* @type boolean
|
57
|
-
* @default false
|
58
|
-
*/
|
59
|
-
focused: {value: false, reflect: true},
|
60
|
-
|
61
|
-
/**
|
62
|
-
* If true, the user is currently holding down the button.
|
63
|
-
*
|
64
|
-
* @attribute pressed
|
65
|
-
* @type boolean
|
66
|
-
* @default false
|
67
|
-
*/
|
68
|
-
pressed: {value: false, reflect: true},
|
69
|
-
|
70
|
-
/**
|
71
|
-
* If true, the user cannot interact with this element.
|
72
|
-
*
|
73
|
-
* @attribute disabled
|
74
|
-
* @type boolean
|
75
|
-
* @default false
|
76
|
-
*/
|
77
|
-
disabled: {value: false, reflect: true},
|
78
|
-
|
79
|
-
/**
|
80
|
-
* If true, the button toggles the active state with each tap.
|
81
|
-
* Otherwise, the button becomes active when the user is holding
|
82
|
-
* it down.
|
83
|
-
*
|
84
|
-
* @attribute isToggle
|
85
|
-
* @type boolean
|
86
|
-
* @default false
|
87
|
-
*/
|
88
|
-
isToggle: {value: false, reflect: false}
|
89
|
-
|
90
|
-
},
|
91
|
-
|
92
|
-
disabledChanged: function() {
|
93
|
-
if (this.disabled) {
|
94
|
-
this.removeAttribute('tabindex');
|
95
|
-
} else {
|
96
|
-
this.setAttribute('tabindex', 0);
|
97
|
-
}
|
98
|
-
},
|
99
|
-
|
100
|
-
downAction: function() {
|
101
|
-
this.pressed = true;
|
102
|
-
this.focused = false;
|
103
|
-
|
104
|
-
if (this.isToggle) {
|
105
|
-
this.active = !this.active;
|
106
|
-
} else {
|
107
|
-
this.active = true;
|
108
|
-
}
|
109
|
-
},
|
110
|
-
|
111
|
-
// Pulling up the context menu for an item should focus it; but we need to
|
112
|
-
// be careful about how we deal with down/up events surrounding context
|
113
|
-
// menus. The up event typically does not fire until the context menu
|
114
|
-
// closes: so we focus immediately.
|
115
|
-
//
|
116
|
-
// This fires _after_ downAction.
|
117
|
-
contextMenuAction: function(e) {
|
118
|
-
// Note that upAction may fire _again_ on the actual up event.
|
119
|
-
this.upAction(e);
|
120
|
-
this.focusAction();
|
121
|
-
},
|
122
|
-
|
123
|
-
upAction: function() {
|
124
|
-
this.pressed = false;
|
125
|
-
|
126
|
-
if (!this.isToggle) {
|
127
|
-
this.active = false;
|
128
|
-
}
|
129
|
-
},
|
130
|
-
|
131
|
-
focusAction: function() {
|
132
|
-
if (!this.pressed) {
|
133
|
-
// Only render the "focused" state if the element gains focus due to
|
134
|
-
// keyboard navigation.
|
135
|
-
this.focused = true;
|
136
|
-
}
|
137
|
-
},
|
138
|
-
|
139
|
-
blurAction: function() {
|
140
|
-
this.focused = false;
|
141
|
-
}
|
142
|
-
|
143
|
-
});
|
144
|
-
|
145
|
-
</script>
|
146
|
-
</polymer-element>
|