update components

This commit is contained in:
Luke Pulverenti 2016-02-22 12:20:38 -05:00
parent 76376601ab
commit 912bd57ca0
20 changed files with 233 additions and 243 deletions

View file

@ -179,9 +179,12 @@ context. You should place this element as a child of `<body>` whenever possible.
if (this._callOpenedWhenReady) {
this._openedChanged();
}
this._observer = Polymer.dom(this).observeNodes(this._onNodesChange);
},
detached: function() {
Polymer.dom(this).unobserveNodes(this._observer);
this._observer = null;
this.opened = false;
this._manager.trackBackdrop(this);
this._manager.removeOverlay(this);
@ -212,7 +215,7 @@ context. You should place this element as a child of `<body>` whenever possible.
},
/**
* Cancels the overlay.
* Cancels the overlay.
* @param {?Event} event The original event
*/
cancel: function(event) {
@ -239,7 +242,6 @@ context. You should place this element as a child of `<body>` whenever possible.
this.removeAttribute('aria-hidden');
} else {
this.setAttribute('aria-hidden', 'true');
Polymer.dom(this).unobserveNodes(this._observer);
}
// wait to call after ready only if we're initially open
@ -330,6 +332,8 @@ context. You should place this element as a child of `<body>` whenever possible.
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();
this.fit();
this._finishPositioning();
@ -362,23 +366,24 @@ context. You should place this element as a child of `<body>` whenever possible.
},
_finishRenderOpened: function() {
// focus the child node with [autofocus]
// This ensures the overlay is visible before we set the focus
// (by calling _onIronResize -> refit).
this.notifyResize();
// Focus the child node with [autofocus]
this._applyFocus();
this._observer = Polymer.dom(this).observeNodes(this.notifyResize);
this.fire('iron-overlay-opened');
},
_finishRenderClosed: function() {
// hide the overlay and remove the backdrop
// Hide the overlay and remove the backdrop.
this.resetFit();
this.style.display = 'none';
this._manager.removeOverlay(this);
this._focusedChild = null;
this._applyFocus();
this.notifyResize();
this.fire('iron-overlay-closed', this.closingReason);
},
@ -391,8 +396,9 @@ context. You should place this element as a child of `<body>` whenever possible.
_finishPositioning: function() {
this.style.display = 'none';
this.style.transform = this.style.webkitTransform = '';
// force layout to avoid application of transform
/** @suppress {suspiciousCode} */ this.offsetWidth;
// Force layout layout to avoid application of transform.
// Set offsetWidth to itself so that compilers won't remove it.
this.offsetWidth = this.offsetWidth;
this.style.transition = this.style.webkitTransition = '';
},
@ -403,6 +409,7 @@ context. You should place this element as a child of `<body>` whenever possible.
}
} else {
this._focusNode.blur();
this._focusedChild = null;
this._manager.focusOverlay();
}
},
@ -444,6 +451,17 @@ context. You should place this element as a child of `<body>` whenever possible.
if (this.opened) {
this.refit();
}
},
/**
* @protected
* Will call notifyResize if overlay is opened.
* Can be overridden in order to avoid multiple observers on the same node.
*/
_onNodesChange: function() {
if (this.opened) {
this.notifyResize();
}
}
/**