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

Commit 8081404

Browse files
committed
fix(fabSpeedDial): fix many visual issues
* maintain state when focusing/bluring/tabbing through actions speed dial would previously show a very short and erroneous animation when tabbing, or rapidly blurring/focusing, through child items * add demo showing tooltip usage * fix $digest in-progress error when opening a dialog cebor reported a $digest in progress bug when trying to open a dialog from within the speed dial; haven't figured out how to create a test that demonstrates it, but I added a demo which shows failure * animations fail on Safari update webkitTransform styles and set height to initial instead of 100% * make changes suggested by gkalpak * more fixes suggested by gkalpak closes #3213, closes #3338, closes #3277, closes #3236, closes #3375
1 parent 9434120 commit 8081404

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<div ng-controller="DemoCtrl as demo" layout="column">
2+
<md-content class="md-padding" layout="column">
3+
<p>
4+
You can also use the buttons to open a dialog.
5+
</p>
6+
7+
<div class="lock-size" layout="row" layout-align="center center">
8+
<md-fab-speed-dial md-direction="down" class="md-fling">
9+
<md-fab-trigger>
10+
<md-button aria-label="Menu" class="md-fab md-warn demo-fab trigger-fab">
11+
<md-tooltip md-direction="top">Menu</md-tooltip>
12+
<md-icon md-svg-src="img/icons/menu.svg"></md-icon>
13+
</md-button>
14+
</md-fab-trigger>
15+
16+
<md-fab-actions>
17+
<md-button aria-label="Open dialog" class="md-fab md-raised md-mini demo-fab action-fab"
18+
ng-click="demo.openDialog($event)">
19+
<md-tooltip md-direction="left">Open dialog</md-tooltip>
20+
<md-icon md-svg-src="img/icons/launch.svg"></md-icon>
21+
</md-button>
22+
</md-fab-actions>
23+
</md-fab-speed-dial>
24+
</div>
25+
</md-content>
26+
27+
<script type="text/ng-template" id="dialog.html">
28+
<md-dialog>
29+
<md-dialog-content>Hello User!!!</md-dialog-content>
30+
31+
<div class="md-actions">
32+
<md-button aria-label="Close dialog" ng-click="dialog.close()" class="md-primary">
33+
Close Greeting
34+
</md-button>
35+
36+
<md-button aria-label="Submit dialog" ng-click="dialog.submit()" class="md-primary">
37+
Submit
38+
</md-button>
39+
</div>
40+
</md-dialog>
41+
</script>
42+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('fabSpeedDialModalDemo', ['ngMaterial'])
5+
.controller('DemoCtrl', function($mdDialog) {
6+
this.openDialog = function($event) {
7+
$mdDialog.show({
8+
clickOutsideToClose: true,
9+
controller: function($mdDialog) {
10+
this.close = function() {
11+
$mdDialog.cancel();
12+
};
13+
this.submit = function() {
14+
$mdDialog.hide();
15+
};
16+
},
17+
controllerAs: 'dialog',
18+
templateUrl: 'dialog.html',
19+
targetEvent: $event
20+
});
21+
}
22+
});
23+
})();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.md-fab.demo-fab.trigger-fab, .md-fab.demo-fab.action-fab {
2+
&:hover, &.md-focused {
3+
background-color: #333;
4+
}
5+
}
6+
7+
.md-fab.demo-fab.action-fab {
8+
background-color: #aaa;
9+
}
10+
11+
.lock-size {
12+
min-width: 300px;
13+
min-height: 300px;
14+
width: 300px;
15+
height: 300px;
16+
margin-left: auto;
17+
margin-right: auto;
18+
}

0 commit comments

Comments
 (0)