update translations
This commit is contained in:
parent
8c75fcc5f7
commit
9622aceeca
40 changed files with 2099 additions and 486 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
@ -34,11 +34,11 @@
|
|||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.1.1",
|
||||
"_release": "1.1.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.1",
|
||||
"commit": "1ed1603ce820456feab3f62ae86f8f3ec801d131"
|
||||
"tag": "v1.1.2",
|
||||
"commit": "40e39a971474f48f5c2c8ee7b8568a0ad5426bd8"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -11,7 +11,7 @@ env:
|
|||
- secure: EaE1AUVgWyn0Y6kqkb54z5r39RvTJzAOmeM0lRl7wXzr5k0mq3VGlxTksJqCVd1PdJESXEhy8eldBnlkwZir/imDTNQxKm13k7ZiFC0000XAzpLZElkH2cLlYCRWcuM+vS7dA9hytV0UcGK2VGqbxfpcesB20dPSneDEUuc5X64=
|
||||
node_js: 4
|
||||
addons:
|
||||
firefox: '42.0'
|
||||
firefox: latest
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
|
|
@ -140,7 +140,6 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
},
|
||||
|
||||
listeners: {
|
||||
'tap': '_onClick',
|
||||
'iron-resize': '_onIronResize'
|
||||
},
|
||||
|
||||
|
@ -162,6 +161,10 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
|
||||
ready: function() {
|
||||
this._ensureSetup();
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
// Call _openedChanged here so that position can be computed correctly.
|
||||
if (this._callOpenedWhenReady) {
|
||||
this._openedChanged();
|
||||
}
|
||||
|
@ -393,20 +396,10 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
},
|
||||
|
||||
_onCaptureClick: function(event) {
|
||||
// attempt to close asynchronously and prevent the close of a tap event is immediately heard
|
||||
// on target. This is because in shadow dom due to event retargetting event.target is not
|
||||
// useful.
|
||||
if (!this.noCancelOnOutsideClick && (this._manager.currentOverlay() == this)) {
|
||||
this._cancelJob = this.async(function() {
|
||||
this.cancel();
|
||||
}, 10);
|
||||
}
|
||||
},
|
||||
|
||||
_onClick: function(event) {
|
||||
if (this._cancelJob) {
|
||||
this.cancelAsync(this._cancelJob);
|
||||
this._cancelJob = null;
|
||||
if (!this.noCancelOnOutsideClick &&
|
||||
this._manager.currentOverlay() === this &&
|
||||
Polymer.dom(event).path.indexOf(this) === -1) {
|
||||
this.cancel();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -415,6 +408,7 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
if (!this.noCancelOnEscKey && (event.keyCode === ESC)) {
|
||||
this.cancel();
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../iron-test-helpers/test-helpers.js"></script>
|
||||
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
|
||||
<link rel="import" href="test-overlay.html">
|
||||
|
||||
</head>
|
||||
|
@ -100,11 +100,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(getComputedStyle(overlay).display, 'none', 'overlay starts hidden');
|
||||
});
|
||||
|
||||
test('overlay open by default', function() {
|
||||
test('overlay open by default', function(done) {
|
||||
overlay = fixture('opened');
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-opened', function() {
|
||||
assert.isTrue(overlay.opened, 'overlay starts opened');
|
||||
assert.notEqual(getComputedStyle(overlay).display, 'none', 'overlay starts showing');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('overlay positioned & sized properly', function(done) {
|
||||
overlay = fixture('opened');
|
||||
overlay.addEventListener('iron-overlay-opened', function() {
|
||||
var s = getComputedStyle(overlay);
|
||||
assert.isTrue(parseFloat(s.left) === (window.innerWidth - overlay.offsetWidth)/2, 'centered horizontally');
|
||||
assert.isTrue(parseFloat(s.top) === (window.innerHeight - overlay.offsetHeight)/2, 'centered vertically');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -181,7 +192,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
overlay.addEventListener('iron-overlay-canceled', function(event) {
|
||||
done();
|
||||
});
|
||||
Polymer.Base.fire.call(document, 'click');
|
||||
MockInteractions.tap(document.body);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -191,7 +202,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.isTrue(event.detail.canceled, 'overlay is canceled');
|
||||
done();
|
||||
});
|
||||
Polymer.Base.fire.call(document, 'click');
|
||||
MockInteractions.tap(document.body);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -204,7 +215,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
throw new Error('iron-overlay-closed should not fire');
|
||||
};
|
||||
overlay.addEventListener('iron-overlay-closed', closedListener);
|
||||
Polymer.Base.fire.call(document, 'click');
|
||||
MockInteractions.tap(document.body);
|
||||
setTimeout(function() {
|
||||
overlay.removeEventListener('iron-overlay-closed', closedListener);
|
||||
done();
|
||||
|
@ -241,7 +252,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
overlay.addEventListener('iron-overlay-closed', function() {
|
||||
assert('iron-overlay-closed should not fire');
|
||||
});
|
||||
Polymer.Base.fire.call(document, 'click');
|
||||
MockInteractions.tap(document.body);
|
||||
setTimeout(function() {
|
||||
done();
|
||||
}, 10);
|
||||
|
@ -282,6 +293,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('ESC closes only one opened overlay', function(done) {
|
||||
runAfterOpen(overlays[0], function() {
|
||||
runAfterOpen(overlays[1], function() {
|
||||
// keydown is sync, keyup async (but no need to wait for it).
|
||||
MockInteractions.pressAndReleaseKeyOn(document.body, 27);
|
||||
// Ideally overlays[1] should be closed and overlays[0] still open,
|
||||
// but in this test env overlays[0]._onCaptureKeydown gets called before
|
||||
// overlays[1]._onCaptureKeydown.
|
||||
// TODO investigate if this is because of CustomEvents in MockInteractions.
|
||||
var opened0 = overlays[0].opened && !overlays[1].opened;
|
||||
var opened1 = !overlays[0].opened && overlays[1].opened;
|
||||
assert.isTrue(opened0 || opened1, 'only one overlay is still opened');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
suite('z-ordering', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue