forked from olton/metroui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetro-panel.js
41 lines (32 loc) · 1.01 KB
/
metro-panel.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( $ ) {
$.widget("metro.panel", {
version: "1.0.0",
options: {
onCollapse: function(){},
onExpand: function(){}
},
_create: function(){
var element = this.element, o = this.options,
header = element.children('.panel-header'),
content = element.children('.panel-content');
header.on('click', function(){
content.slideToggle(
'fast',
function(){
element.toggleClass('collapsed');
if (element.hasClass('collapsed')) {
o.onCollapse();
} else {
o.onExpand();
}
}
);
});
},
_destroy: function(){
},
_setOption: function(key, value){
this._super('_setOption', key, value);
}
})
})( jQuery );