update components
This commit is contained in:
parent
8c738547c6
commit
52f247c51a
29 changed files with 185 additions and 402 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
@ -35,11 +35,11 @@
|
|||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.5.3",
|
||||
"_release": "1.5.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.5.3",
|
||||
"commit": "49d4c3fb1525aa14911cbda46f0997641c93bbe0"
|
||||
"tag": "v1.5.4",
|
||||
"commit": "ee81b7ae2e63fea82e60df17669fb07a65046a8c"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
|
|
@ -292,6 +292,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the deepest overlay in the path.
|
||||
* @param {?Array<Element>} path
|
||||
* @return {Element|undefined}
|
||||
* @private
|
||||
*/
|
||||
_overlayInPath: function(path) {
|
||||
path = path || [];
|
||||
for (var i = 0; i < path.length; i++) {
|
||||
if (path[i]._manager === this) {
|
||||
return path[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Ensures the click event is delegated to the right overlay.
|
||||
* @param {!Event} event
|
||||
|
@ -299,9 +314,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
*/
|
||||
_onCaptureClick: function(event) {
|
||||
var overlay = /** @type {?} */ (this.currentOverlay());
|
||||
// Check if clicked outside of any overlay.
|
||||
var target = /** @type {Element} */ (Polymer.dom(event).rootTarget);
|
||||
if (overlay && this._overlayParent(target) !== overlay) {
|
||||
// Check if clicked outside of top overlay.
|
||||
if (overlay && this._overlayInPath(Polymer.dom(event).path) !== overlay) {
|
||||
overlay._onCaptureClick(event);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -25,6 +25,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="test-overlay.html">
|
||||
<link rel="import" href="test-overlay2.html">
|
||||
<link rel="import" href="test-buttons.html">
|
||||
<link rel="import" href="test-menu-button.html">
|
||||
|
||||
<style is="custom-style">
|
||||
iron-overlay-backdrop {
|
||||
|
@ -113,6 +114,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="composed">
|
||||
<template>
|
||||
<test-menu-button>
|
||||
Composed overlay
|
||||
<button>Button</button>
|
||||
</test-menu-button>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-buttons id="buttons"></test-buttons>
|
||||
<input id="focusInput" placeholder="focus input">
|
||||
|
||||
|
@ -925,6 +935,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
});
|
||||
|
||||
suite('overlay in composed tree', function() {
|
||||
test('click on overlay content does not close it', function(done) {
|
||||
var composed = fixture('composed');
|
||||
// Opens overlay.
|
||||
MockInteractions.tap(composed.$.trigger);
|
||||
composed.$.dropdown.addEventListener('iron-overlay-opened', function() {
|
||||
// Tap on button inside overlay.
|
||||
MockInteractions.tap(Polymer.dom(composed).querySelector('button'));
|
||||
Polymer.Base.async(function(){
|
||||
assert.isTrue(composed.$.dropdown.opened, 'overlay still opened');
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
suite('a11y', function() {
|
||||
|
||||
test('overlay has aria-hidden=true when opened', function() {
|
||||
|
|
36
dashboard-ui/bower_components/iron-overlay-behavior/test/test-menu-button.html
vendored
Normal file
36
dashboard-ui/bower_components/iron-overlay-behavior/test/test-menu-button.html
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="test-overlay.html">
|
||||
|
||||
<dom-module id="test-menu-button">
|
||||
|
||||
<template>
|
||||
<button id="trigger" on-click="toggle">Open</button>
|
||||
<test-overlay id="dropdown">
|
||||
<content></content>
|
||||
</test-overlay>
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
(function() {
|
||||
Polymer({
|
||||
is: 'test-menu-button',
|
||||
toggle: function() {
|
||||
this.$.dropdown.toggle();
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue