update components
This commit is contained in:
parent
9337fa578f
commit
465ea29e6b
17 changed files with 477 additions and 63 deletions
|
@ -66,10 +66,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* Ensures this element contains a ripple effect. For startup efficiency
|
||||
* the ripple effect is dynamically on demand when needed.
|
||||
* @param {!Event=} opt_triggeringEvent (optional) event that triggered the
|
||||
* @param {!Event=} optTriggeringEvent (optional) event that triggered the
|
||||
* ripple.
|
||||
*/
|
||||
ensureRipple: function(opt_triggeringEvent) {
|
||||
ensureRipple: function(optTriggeringEvent) {
|
||||
if (!this.hasRipple()) {
|
||||
this._ripple = this._createRipple();
|
||||
this._ripple.noink = this.noink;
|
||||
|
@ -77,12 +77,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
if (rippleContainer) {
|
||||
Polymer.dom(rippleContainer).appendChild(this._ripple);
|
||||
}
|
||||
var domContainer = rippleContainer === this.shadyRoot ? this :
|
||||
rippleContainer;
|
||||
if (opt_triggeringEvent) {
|
||||
var target = opt_triggeringEvent.target;
|
||||
if (domContainer.contains(/** @type {Node} */(target))) {
|
||||
this._ripple.uiDownAction(opt_triggeringEvent);
|
||||
if (optTriggeringEvent) {
|
||||
// Check if the event happened inside of the ripple container
|
||||
// Fall back to host instead of the root because distributed text
|
||||
// nodes are not valid event targets
|
||||
var domContainer = Polymer.dom(this._rippleContainer || this);
|
||||
var target = Polymer.dom(optTriggeringEvent).rootTarget;
|
||||
if (domContainer.deepContains( /** @type {Node} */(target))) {
|
||||
this._ripple.uiDownAction(optTriggeringEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue