Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(ripple): ripple will no longer be triggered on disabled elements
Browse files Browse the repository at this point in the history
Closes #5445
  • Loading branch information
Robert Messerle committed Sep 14, 2015
1 parent c7f2d64 commit 313342c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/services/ripple/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,21 @@ InkRippleCtrl.prototype.clearTimeout = function () {
}
};

InkRippleCtrl.prototype.isRippleAllowed = function () {
var element = this.$element[0];
do {
if (element && element.hasAttribute && element.hasAttribute('disabled')) return false;
} while (element = element.parentNode);
};

/**
* Creates a new ripple and adds it to the container. Also tracks ripple in `this.ripples`.
* @param left
* @param top
*/
InkRippleCtrl.prototype.createRipple = function (left, top) {
if (!this.isRippleAllowed()) return;

var ctrl = this;
var ripple = angular.element('<div class="md-ripple"></div>');
var width = this.$element.prop('clientWidth');
Expand Down

0 comments on commit 313342c

Please sign in to comment.