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

Commit

Permalink
fix(ripple): fixes issues with ripples on items below the fold
Browse files Browse the repository at this point in the history
Closes #2028
Closes #1526
  • Loading branch information
Robert Messerle committed Mar 25, 2015
1 parent b682e36 commit e0f9fe9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/services/ripple/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down

0 comments on commit e0f9fe9

Please sign in to comment.