Ensure to remove only the tab from the list of tabs

Tab.close can be called multiple times (ex: closing wizard running in a tab)
so the indexOf can return -1 if the tab has already been removed.

issue8431
review263691002
This commit is contained in:
Cédric Krier committed 2019-07-08 18:49:22 +02:00
1 parent 7474935810
commit 3557de1de3
1 file changed
+4 -1
+4 -1
View File
@@ -283,7 +283,10 @@
}
tab.remove();
content.remove();
Sao.Tab.tabs.splice(Sao.Tab.tabs.indexOf(this), 1);
var i = Sao.Tab.tabs.indexOf(this);
if (i >= 0) {
Sao.Tab.tabs.splice(i, 1);
}
if (next.length) {
next.find('a').tab('show');
} else {