forked from iNavFlight/inav-configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabs.js
27 lines (19 loc) · 723 Bytes
/
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
'use strict';
var tabs = (function () {
let self = {},
$container;
function onHeaderClick(event) {
let $cT = $(event.currentTarget),
attrFor = $cT.attr("for");
$container.find('.subtab__header_label').removeClass("subtab__header_label--current");
$cT.addClass("subtab__header_label--current");
$container.find(".subtab__content--current").removeClass("subtab__content--current");
$container.find("#" + attrFor).addClass("subtab__content--current");
};
self.init = function ($dom) {
$container = $dom;
$container.find(".subtab__header_label").on('click', onHeaderClick);
};
return self;
})();
module.exports = tabs;