How not to work-click on the active tab?

hi! wrote tab, but every time I solve the following: if the active tab I app can you use it to click, but do not... put a check that if the tab is active, you cannot click on it, but Chet got me?... here is the source code
(function() {
 var tabsControl = $('.toi-tabs-control li');
 var tabsContent = $('.toi-tabs-content article');
 var tabsControlHeight = 0;
 var maxTabsControlHeight = 0;

 // Calculate Control Height
 tabsControl.each(function() {
 var control = $(this);
 var controlHeight = control.height();
 if (maxTabsControlHeight < controlHeight) {
 maxTabsControlHeight = controlHeight;
}
});

 // Set Control Height
 tabsControl.each(function(i) {
$(this).height(maxTabsControlHeight);
tabsControlHeight+=maxTabsControlHeight;
 if (!!i) {
tabsControlHeight+=20;
}
});

 tabsContent.each(function() {
 $(this).find('.description').css('min-height', tabsControlHeight - 200 + "px");
});

 // Add Event Handler
 tabsControl.on('click', function(e) {
e.preventDefault();
 var listItem = $(this);
 var btn = listItem.find('a');
 var att = btn.attr('href').slice(1);

 // Change Tab
 tabsContent.fadeOut(100, function() {
$(this).removeClass('active');
});

 tabsContent.each(function() {
 var tab = $(this);
 if (tab.attr('id') == att) {
 tab.delay(100).fadeIn(100, function() {
tab.addClass('active');
})
}
});

 // Change Active
tabsControl.removeClass('active');
listItem.addClass('active');
})
 }());
June 8th 19 at 17:09
2 answers
June 8th 19 at 17:11
Solution
So be a little nicer
tabsControl.on('click', ':not(.active)', function (e) {
e.preventDefault();
 .... // if no active
June 8th 19 at 17:13
Solution
Add

...
tabsControl.on('click', function (e) {
e.preventDefault();
 if(tabsControl.hasClass('active')) {
return;
}
 ...

Find more questions by tags JavaScriptjQuery