Skip to content

Commit b7fad8c

Browse files
committed
fix destroy function
1 parent 4e37b02 commit b7fad8c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/js/jquery.smartTab.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,12 @@
595595
let instance = $.data(this[0], 'smartTab');
596596

597597
if (options === 'destroy') {
598-
$.data(this, 'smartTab', null);
598+
if (instance != null) {
599+
instance.tabs.off("click");
600+
instance.main.data('click-init', false)
601+
$.data(this[0], 'smartTab', null);
602+
}
603+
return this;
599604
}
600605

601606
if (instance instanceof SmartTab && typeof instance[options] === 'function') {

0 commit comments

Comments
 (0)