forked from fex-team/kityminder-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopTab.directive.js
39 lines (36 loc) · 1.24 KB
/
topTab.directive.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
angular.module('kityminderEditor')
.directive('topTab', function () {
return {
restrict: 'A',
templateUrl: 'ui/directive/topTab/topTab.html',
scope: {
minder: '=topTab',
editor: '='
},
link: function (scope) {
var selectedTab = 'idea';
scope.selectTopTab = function (tab) {
if (selectedTab === tab) {
$('.tab-content').animate({
height: 0,
display: 'none'
});
$('.minder-editor').animate({
top: '32px'
});
return selectedTab = null;
}
if (selectedTab === null) {
$('.tab-content').animate({
height: '60px',
display: 'block'
});
$('.minder-editor').animate({
top: '92px'
});
}
selectedTab = tab;
};
}
}
});