-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
69 lines (56 loc) · 1.73 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var demo = angular.module('demo', ['ng-mfb']);
demo.controller('myCtrl', Ctrl);
function Ctrl(defaultValues, $window){
var vm = this;
console.log("ctrl");
vm.positions = defaultValues.positions;
vm.effects = defaultValues.effects;
vm.methods = defaultValues.methods;
vm.actions = defaultValues.actions;
vm.menuState = 'closed';
vm.loc = loc;
vm.setMainAction = setMainAction;
vm.mainAction = mainAction;
vm.chosen = {
effect : 'zoomin',
position : 'br',
method : 'click',
action : 'fire'
};
vm.buttons = [{
label: 'View on Github',
icon: 'ion-social-github',
href: 'https://github.com/nobitagit/ng-material-floating-button/'
},{
label: 'Follow me on Github',
icon: 'ion-social-octocat',
href: 'https://github.com/nobitagit'
},{
label: 'Share on Twitter',
icon: 'ion-social-twitter',
href: 'http://twitter.com/share?text=Amazing material floating action button directive!&url=http://nobitagit.github.io/ng-material-floating-button/&hashtags=angular,material,design,button'
}];
function loc(href) {
$window.location.href = href;
}
function mainAction() {
//console.log('Firing Main Action!');
}
function setMainAction() {
if(vm.chosen.action === 'fire') {
vm.mainAction = mainAction;
} else {
vm.mainAction = null;
}
}
}
Ctrl.prototype.hovered = function() {
// toggle something on hover.
};
Ctrl.prototype.toggle = function() {
this.menuState = this.menuState === 'closed' ? 'open' : 'closed';
};
Ctrl.prototype.closeMenu = function() {
this.menuState = 'closed';
};
Ctrl.$inject = ['defaultValues', '$window'];