Bump builds
parent
6e4a34066b
commit
417f2254d9
|
@ -306,26 +306,25 @@ MaterialButton.prototype.Constant_ = {
|
|||
* @private
|
||||
*/
|
||||
MaterialButton.prototype.CssClasses_ = {
|
||||
WSK_JS_RIPPLE_EFFECT: 'wsk-js-ripple-effect',
|
||||
|
||||
WSK_BUTTON_RIPPLE_CONTAINER: 'wsk-button__ripple-container',
|
||||
|
||||
WSK_RIPPLE: 'wsk-ripple'
|
||||
RIPPLE_EFFECT: 'wsk-js-ripple-effect',
|
||||
RIPPLE_CONTAINER: 'wsk-button__ripple-container',
|
||||
RIPPLE: 'wsk-ripple'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handle blur of element.
|
||||
* @param {HTMLElement} element The instance of a button we want to blur.
|
||||
* @private
|
||||
*/
|
||||
MaterialButton.prototype.blurHandlerGenerator_ = function(element) {
|
||||
MaterialButton.prototype.blurHandler = function(event) {
|
||||
'use strict';
|
||||
|
||||
return function() {element.blur();};
|
||||
// Don't fire for the artificial "mouseup" generated by a double-click.
|
||||
if (event && event.detail !== 2) {
|
||||
this.element_.blur();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Initialize element.
|
||||
*/
|
||||
|
@ -333,23 +332,19 @@ MaterialButton.prototype.init = function() {
|
|||
'use strict';
|
||||
|
||||
if (this.element_) {
|
||||
var blurHandler = this.blurHandlerGenerator_(this.element_);
|
||||
if (this.element_.classList.contains(
|
||||
this.CssClasses_.WSK_JS_RIPPLE_EFFECT)) {
|
||||
if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) {
|
||||
var rippleContainer = document.createElement('span');
|
||||
rippleContainer.classList.add(
|
||||
this.CssClasses_.WSK_BUTTON_RIPPLE_CONTAINER);
|
||||
rippleContainer.classList.add(this.CssClasses_.RIPPLE_CONTAINER);
|
||||
var ripple = document.createElement('span');
|
||||
ripple.classList.add(this.CssClasses_.WSK_RIPPLE);
|
||||
ripple.classList.add(this.CssClasses_.RIPPLE);
|
||||
rippleContainer.appendChild(ripple);
|
||||
ripple.addEventListener('mouseup', blurHandler);
|
||||
ripple.addEventListener('mouseup', this.blurHandler.bind(this));
|
||||
this.element_.appendChild(rippleContainer);
|
||||
}
|
||||
this.element_.addEventListener('mouseup', blurHandler);
|
||||
this.element_.addEventListener('mouseup', this.blurHandler.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// The component registers itself. It can assume componentHandler is available
|
||||
// in the global scope.
|
||||
componentHandler.register({
|
||||
|
@ -2690,7 +2685,6 @@ MaterialRipple.prototype.CssClasses_ = {
|
|||
MaterialRipple.prototype.downHandler_ = function(event) {
|
||||
'use strict';
|
||||
|
||||
console.log(event);
|
||||
this.rippleElement_.classList.add(this.CssClasses_.IS_VISIBLE);
|
||||
|
||||
if (event.type === 'mousedown' && this.ignoringMouseDown_) {
|
||||
|
@ -2731,9 +2725,10 @@ MaterialRipple.prototype.downHandler_ = function(event) {
|
|||
MaterialRipple.prototype.upHandler_ = function(event) {
|
||||
'use strict';
|
||||
|
||||
console.log(2, event);
|
||||
|
||||
this.rippleElement_.classList.remove(this.CssClasses_.IS_VISIBLE);
|
||||
// Don't fire for the artificial "mouseup" generated by a double-click.
|
||||
if (event && event.detail !== 2) {
|
||||
this.rippleElement_.classList.remove(this.CssClasses_.IS_VISIBLE);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue