Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
fix(ripple): fixes size issue with ripple on switches
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Messerle committed Jan 28, 2015
1 parent e3e38ea commit c435409
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/services/ripple/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ function InkRippleService($window, $timeout) {
function attachCheckboxBehavior(scope, element, options) {
return attach(scope, element, angular.extend({
center: true,
dimBackground: false
dimBackground: false,
fitRipple: true
}, options));
}

Expand All @@ -67,7 +68,8 @@ function InkRippleService($window, $timeout) {
dimBackground: false,
outline: false,
isFAB: false,
isMenuItem: false
isMenuItem: false,
fitRipple: false
}, options);

var rippleSize,
Expand Down Expand Up @@ -283,6 +285,9 @@ function InkRippleService($window, $timeout) {
} else {
multiplier = options.isFAB ? 1.1 : 0.8;
size = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)) * multiplier;
if (options.fitRipple) {
size = Math.min(height, width, size);
}
}
return size;
}
Expand Down

0 comments on commit c435409

Please sign in to comment.