Merge pull request #55 from google/rippleContainer-fix

Only use rippleContainer inside the `if` ensuring its existence
master
Addy Osmani 2015-03-18 13:17:02 +00:00
commit 47e6ba47be
1 changed files with 1 additions and 1 deletions

View File

@ -176,6 +176,7 @@ MaterialSwitch.prototype.init = function() {
this.CssClasses_.WSK_SWITCH_RIPPLE_CONTAINER);
rippleContainer.classList.add(this.CssClasses_.WSK_JS_RIPPLE_EFFECT);
rippleContainer.classList.add(this.CssClasses_.WSK_RIPPLE_CENTER);
rippleContainer.addEventListener('mouseup', this.onMouseUp_.bind(this));
var ripple = document.createElement('span');
ripple.classList.add(this.CssClasses_.WSK_RIPPLE);
@ -192,7 +193,6 @@ MaterialSwitch.prototype.init = function() {
this.element_.addEventListener('mouseup', this.onMouseUp_.bind(this));
rippleContainer.addEventListener('mouseup', this.onMouseUp_.bind(this));
this.updateClasses_(this.btnElement_, this.element_);
this.element_.classList.add('is-upgraded');