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

Commit

Permalink
fix(fabSpeedDial): animations fail on Safari
Browse files Browse the repository at this point in the history
update webkitTransform styles and set height to initial instead of 100%

references #3375
  • Loading branch information
topherfangio committed Jun 26, 2015
1 parent d491cfd commit 919ca98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/components/fabSpeedDial/fabSpeedDial.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,19 @@
angular.forEach(items, function(item, index) {
var styles = item.style;

styles.transform = '';
styles.transform = styles.webkitTransform = '';
styles.transitionDelay = '';
styles.opacity = 1;

// Make the items closest to the trigger have the highest z-index
item.style.zIndex = (items.length - index) + startZIndex;
styles.zIndex = (items.length - index) + startZIndex;
});

// If the control is closed, hide the items behind the trigger
if (!ctrl.isOpen) {
angular.forEach(items, function(item, index) {
var newPosition, axis;
var styles = item.style;

switch (ctrl.direction) {
case 'up':
Expand All @@ -191,7 +192,9 @@
break;
}

item.style.transform = 'translate' + axis + '(' + newPosition + 'px)';
var newTranslate = 'translate' + axis + '(' + newPosition + 'px)';

styles.transform = styles.webkitTransform = newTranslate;
});
}
}
Expand Down Expand Up @@ -222,7 +225,7 @@
offsetDelay = index * delay;

styles.opacity = ctrl.isOpen ? 1 : 0;
styles.transform = ctrl.isOpen ? 'scale(1)' : 'scale(0)';
styles.transform = styles.webkitTransform = ctrl.isOpen ? 'scale(1)' : 'scale(0)';
styles.transitionDelay = (ctrl.isOpen ? offsetDelay : (items.length - offsetDelay)) + 'ms';
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/fabSpeedDial/fabSpeedDial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ md-fab-speed-dial {
display: flex;

// Set the height so that the z-index in the JS animation works
height: 100%;
height: initial;

.md-fab-action-item {
visibility: hidden;
Expand Down

0 comments on commit 919ca98

Please sign in to comment.