diff --git a/dashboard-ui/bower_components/iron-icon/.bower.json b/dashboard-ui/bower_components/iron-icon/.bower.json index 9784e3a3b..f0167baf1 100644 --- a/dashboard-ui/bower_components/iron-icon/.bower.json +++ b/dashboard-ui/bower_components/iron-icon/.bower.json @@ -32,14 +32,14 @@ "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/PolymerElements/iron-icon", + "homepage": "https://github.com/polymerelements/iron-icon", "_release": "1.0.8", "_resolution": { "type": "version", "tag": "v1.0.8", "commit": "f36b38928849ef3853db727faa8c9ef104d611eb" }, - "_source": "git://github.com/PolymerElements/iron-icon.git", + "_source": "git://github.com/polymerelements/iron-icon.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-icon" + "_originalSource": "polymerelements/iron-icon" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json index 8872c81d8..e119efc7f 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-overlay-behavior", - "version": "1.5.1", + "version": "1.5.2", "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.1", + "_release": "1.5.2", "_resolution": { "type": "version", - "tag": "v1.5.1", - "commit": "b6f4126ecbfdc9dc149beac8e7fbe201bbd14ad5" + "tag": "v1.5.2", + "commit": "740705930a3d30c8381e75f379aeea5eae89847b" }, "_source": "git://github.com/polymerelements/iron-overlay-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.github/ISSUE_TEMPLATE.md b/dashboard-ui/bower_components/iron-overlay-behavior/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..9925d3744 --- /dev/null +++ b/dashboard-ui/bower_components/iron-overlay-behavior/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,33 @@ + +### Description + + +### Expected outcome + + + +### Actual outcome + + + +### Live Demo + + +### Steps to reproduce + + + +### Browsers Affected + +- [ ] Chrome +- [ ] Firefox +- [ ] Safari 9 +- [ ] Safari 8 +- [ ] Safari 7 +- [ ] Edge +- [ ] IE 11 +- [ ] IE 10 diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json index cb510f339..f0915e8b1 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-overlay-behavior", - "version": "1.5.1", + "version": "1.5.2", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html index 847172644..e9295ac4a 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html @@ -306,16 +306,13 @@ context. You should place this element as a child of `` whenever possible. return; } + this._manager.addOrRemoveOverlay(this); + this.__isAnimating = true; if (this.opened) { this._prepareRenderOpened(); - } else { - this._manager.removeOverlay(this); } - - this._manager.trackBackdrop(this); - if (this._openChangedAsync) { this.cancelAsync(this._openChangedAsync); } @@ -350,7 +347,7 @@ context. You should place this element as a child of `` whenever possible. this.__shouldRemoveTabIndex = false; } if (this.opened) { - this._manager.trackBackdrop(this); + this._manager.trackBackdrop(); if (this.withBackdrop) { this.backdropElement.prepare(); // Give time to be added to document. @@ -369,8 +366,6 @@ context. You should place this element as a child of `` whenever possible. */ _prepareRenderOpened: function() { - this._manager.addOverlay(this); - // Needed to calculate the size of the overlay so that transitions on its size // will have the correct starting points. this._preparePositioning(); diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html index fa98b86da..104859e61 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html @@ -77,11 +77,56 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN return active; }, + /** + * Brings the overlay at the specified index to the front. + * @param {number} i + * @private + */ + _bringOverlayAtIndexToFront: function(i) { + var overlay = this._overlays[i]; + var lastI = this._overlays.length - 1; + // If already the top element, return. + if (!overlay || i === lastI) { + return; + } + // Update z-index to be on top. + var minimumZ = Math.max(this.currentOverlayZ(), this._minimumZ); + if (this._getZ(overlay) <= minimumZ) { + this._applyOverlayZ(overlay, minimumZ); + } + + // Shift other overlays behind the new on top. + while (i < lastI) { + this._overlays[i] = this._overlays[i + 1]; + i++; + } + this._overlays[lastI] = overlay; + }, + + /** + * Adds the overlay and updates its z-index if it's opened, or removes it if it's closed. + * Also updates the backdrop z-index. + * @param {Element} overlay + */ + addOrRemoveOverlay: function(overlay) { + if (overlay.opened) { + this.addOverlay(overlay); + } else { + this.removeOverlay(overlay); + } + this.trackBackdrop(); + }, + /** * Tracks overlays for z-index and focus management. * @param {Element} overlay */ addOverlay: function(overlay) { + var i = this._overlays.indexOf(overlay); + if (i >= 0) { + this._bringOverlayAtIndexToFront(i); + return; + } var minimumZ = Math.max(this.currentOverlayZ(), this._minimumZ); this._overlays.push(overlay); var newZ = this.currentOverlayZ(); @@ -97,16 +142,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN */ removeOverlay: function(overlay) { var i = this._overlays.indexOf(overlay); - if (i >= 0) { - this._overlays.splice(i, 1); - this._setZ(overlay, ''); + if (i === -1) { + return; + } + this._overlays.splice(i, 1); + this._setZ(overlay, ''); - var node = overlay.restoreFocusOnClose ? overlay.restoreFocusNode : null; - overlay.restoreFocusNode = null; - // Focus back only if still contained in document.body - if (node && Polymer.dom(document.body).deepContains(node)) { - node.focus(); - } + var node = overlay.restoreFocusOnClose ? overlay.restoreFocusNode : null; + overlay.restoreFocusNode = null; + // Focus back only if still contained in document.body + if (node && Polymer.dom(document.body).deepContains(node)) { + node.focus(); } }, @@ -152,9 +198,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, /** - * @param {Element} overlay The overlay that updated its withBackdrop. + * Updates the backdrop z-index. */ - trackBackdrop: function(overlay) { + trackBackdrop: function() { this.backdropElement.style.zIndex = this.backdropZ(); }, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html index 03eb4342a..2e66656e3 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html @@ -751,6 +751,55 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN done(); }) }); + + }); + + suite('Manager overlays in sync', function() { + var overlay1, overlay2; + var overlays; + + setup(function() { + var f = fixture('multiple'); + overlay1 = f[0]; + overlay2 = f[1]; + overlays = Polymer.IronOverlayManager._overlays; + }); + + test('no duplicates after attached', function(done) { + overlay1 = document.createElement('test-overlay'); + overlay1.addEventListener('iron-overlay-opened',function() { + assert.equal(overlays.length, 1, 'correct count after open and attached'); + document.body.removeChild(overlay1); + done(); + }); + overlay1.opened = true; + assert.equal(overlays.length, 1, 'immediately updated'); + document.body.appendChild(overlay1); + }); + + test('open twice handled', function() { + overlay1.open(); + assert.equal(overlays.length, 1, '1 overlay after open'); + overlay1.open(); + assert.equal(overlays.length, 1, '1 overlay after second open'); + }); + + test('close handled', function() { + overlay1.open(); + overlay1.close(); + assert.equal(overlays.length, 0, '0 overlays after close'); + }); + + test('open/close brings overlay on top', function() { + overlay1.open(); + overlay2.open(); + assert.equal(overlays.indexOf(overlay1), 0, 'overlay1 at index 0'); + assert.equal(overlays.indexOf(overlay2), 1, 'overlay2 at index 1'); + overlay1.close(); + overlay1.open(); + assert.equal(overlays.indexOf(overlay1), 1, 'overlay1 moved at index 1'); + assert.isAbove(parseInt(overlay1.style.zIndex), parseInt(overlay2.style.zIndex), 'overlay1 on top of overlay2'); + }); }); suite('z-ordering', function() {