From e0f9fe98b24e028f80acf662b8a69e2f582529f2 Mon Sep 17 00:00:00 2001 From: Robert Messerle Date: Wed, 25 Mar 2015 09:29:03 -0700 Subject: [PATCH] fix(ripple): fixes issues with ripples on items below the fold Closes #2028 Closes #1526 --- src/core/services/ripple/ripple.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/services/ripple/ripple.js b/src/core/services/ripple/ripple.js index 7ea6dc4400a..d667b902cf1 100644 --- a/src/core/services/ripple/ripple.js +++ b/src/core/services/ripple/ripple.js @@ -303,8 +303,7 @@ function InkRippleService($window, $timeout) { * @returns {{backgroundColor: string, borderColor: string, width: string, height: string}} */ function getRippleCss(size, left, top) { - var rect, - css = { + var css = { backgroundColor: rgbaToRGB(color), borderColor: rgbaToRGB(color), width: size + 'px', @@ -321,9 +320,8 @@ function InkRippleService($window, $timeout) { if (options.center) { css.left = css.top = '50%'; } else { - rect = node.getBoundingClientRect(); - css.left = Math.round((left - rect.left) / container.prop('offsetWidth') * 100) + '%'; - css.top = Math.round((top - rect.top) / container.prop('offsetHeight') * 100) + '%'; + css.left = Math.round((left - node.offsetLeft) / container.prop('offsetWidth') * 100) + '%'; + css.top = Math.round((top - node.offsetTop) / container.prop('offsetHeight') * 100) + '%'; } return css;