update polymer

This commit is contained in:
Luke Pulverenti 2015-10-27 10:58:38 -04:00
parent 6825ae319e
commit 2d53ff29c5
106 changed files with 3070 additions and 1567 deletions

View file

@ -13,14 +13,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
/**
* `Polymer.PaperRippleBehavior` dynamically implements a ripple
/**
* `Polymer.PaperRippleBehavior` dynamically implements a ripple
* when the element has focus via pointer or keyboard.
*
* NOTE: This behavior is intended to be used in conjunction with and after
* `Polymer.IronButtonState` and `Polymer.IronControlState`.
*
* @polymerBehavior Polymer.PaperRippleBehavior
* @polymerBehavior Polymer.PaperRippleBehavior
*/
Polymer.PaperRippleBehavior = {
@ -32,11 +32,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
noink: {
type: Boolean,
observer: '_noinkChanged'
},
/**
* @type {Element|undefined}
*/
_rippleContainer: {
type: Object,
}
},
/**
* Ensures a `<paper-ripple>` element is available when the element is
* Ensures a `<paper-ripple>` element is available when the element is
* focused.
*/
_buttonStateChanged: function() {
@ -45,7 +52,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
},
/**
/**
* In addition to the functionality provided in `IronButtonState`, ensures
* a ripple effect is created when the element is in a `pressed` state.
*/
@ -57,12 +64,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
* Ensures this element contains a ripple effect. For startup efficiency
* Ensures this element contains a ripple effect. For startup efficiency
* the ripple effect is dynamically on demand when needed.
* @param {event} triggeringEvent (optional) event that triggered the
* @param {!Event=} opt_triggeringEvent (optional) event that triggered the
* ripple.
*/
ensureRipple: function(triggeringEvent) {
ensureRipple: function(opt_triggeringEvent) {
if (!this.hasRipple()) {
this._ripple = this._createRipple();
this._ripple.noink = this.noink;
@ -70,10 +77,13 @@ 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 :
var domContainer = rippleContainer === this.shadyRoot ? this :
rippleContainer;
if (triggeringEvent && domContainer.contains(triggeringEvent.target)) {
this._ripple.uiDownAction(triggeringEvent);
if (opt_triggeringEvent) {
var target = opt_triggeringEvent.target;
if (domContainer.contains(/** @type {Node} */(target))) {
this._ripple.uiDownAction(opt_triggeringEvent);
}
}
}
},
@ -81,7 +91,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* Returns the `<paper-ripple>` element used by this element to create
* ripple effects. The element's ripple is created on demand, when
* necessary, and calling this method will force the
* necessary, and calling this method will force the
* ripple to be created.
*/
getRipple: function() {
@ -100,10 +110,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* Create the element's ripple effect via creating a `<paper-ripple>`.
* Override this method to customize the ripple element.
* @return {element} Returns a `<paper-ripple>` element.
* @return {!PaperRippleElement} Returns a `<paper-ripple>` element.
*/
_createRipple: function() {
return document.createElement('paper-ripple');
return /** @type {!PaperRippleElement} */ (
document.createElement('paper-ripple'));
},
_noinkChanged: function(noink) {