-
Notifications
You must be signed in to change notification settings - Fork 0
/
popover.html
54 lines (43 loc) · 1.48 KB
/
popover.html
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
<script>
(function (root, factory) {
root.Elliptical.Behaviors=root.Elliptical.Behaviors || {};
root.Elliptical.Behaviors.PopOver=factory();
}(this, function () {
return {
_assignWidth: function (width) {
var content = this._content();
content.css({ width: width + 'px' });
},
_assignTop: function (top) {
var content = this._content();
content.css({ top: top + 'px' });
},
_content:function(){
return this._data.get('content');
},
__events: function () {
var click = this._data.click;
this._event(this.element, click, this._onClick.bind(this));
},
_onClick: function () {
var content = this._content();
if (content.hasClass('show')) {
this._hide();
} else {
this._show();
}
},
_show: function () {
var content = this._content();
content.addClass('show');
this._transitions(content, { opacity: 1, duration: 300 }, function () {
});
},
_hide: function () {
var content = this._content();
content.removeClass('show');
content.css({ opacity: '' });
}
};
}));
</script>