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 container self-removal NPE fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBurleson committed Sep 24, 2014
1 parent ecea594 commit 664ab99
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/animate/inkCssRipple.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,22 @@ function InkRippleService($window, $$rAF, $materialEffects, $timeout) {
var node = element[0];

if (options.mousedown) {
enableMousedown(true);
listenPointerDown(true);
}

// Publish self-detach method if desired...
return function detach() {
enableMousedown(false);
listenPointerDown(false);

rippleContainer
.parent
if ( rippleContainer ) {
// Self-removal of injected container...
rippleContainer
.parent()
.remove( rippleContainer );
}
}
};

function enableMousedown(active) {
function listenPointerDown(active) {
if ( !active) element.off(POINTERDOWN_EVENT, onPointerDown);
else element.on(POINTERDOWN_EVENT, onPointerDown);
}
Expand Down

0 comments on commit 664ab99

Please sign in to comment.