/
vertical-tabs.js
44 lines (42 loc) · 906 Bytes
/
vertical-tabs.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
/*
* jQuery UI Vertical Tabs 0.1.1
* https://github.com/tjvantoll/jquery-ui-vertical-tabs
*
* Copyright TJ VanToll
* Released under the MIT license.
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
define([
"jquery",
"jquery-ui/widget",
"jquery-ui/tabs"
], factory );
} else {
factory( jQuery );
}
}(function( $ ) {
return $.widget( "ui.tabs", $.ui.tabs, {
options: {
orientation: "horizontal"
},
_create: function() {
this._super();
this._handleOrientation();
},
_handleOrientation: function() {
this.element.toggleClass( "ui-tabs-vertical",
this.options.orientation === "vertical" );
},
_setOption: function( key, value ) {
this._superApply( arguments );
if ( key === "orientation" ) {
this._handleOrientation();
}
},
_destroy: function() {
this._super();
this.element.removeClass( "ui-tabs-vertical" );
}
});
}));