forked from romainberger/angular-qtip2-directive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqtip2.js
39 lines (34 loc) · 868 Bytes
/
qtip2.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
!function($) {
'use strict';
angular.module('qtip2', [])
.directive('qtip', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var my = attrs.my || 'bottom center'
, at = attrs.at || 'top center'
, qtipClass = attrs.class || 'qtip'
, content
if (attrs.title) {
content = {'title': attrs.title, 'text': attrs.content}
}
else {
content = attrs.content
}
$(element).qtip({
content: content,
position: {
my: my,
at: at,
target: element
},
hide: {
fixed : true,
delay : 100
},
style: qtipClass
})
}
}
})
}(window.jQuery);