changeset cc2f70b855d5 in sao:4.6
details: https://hg.tryton.org/sao?cmd=changeset;node=cc2f70b855d5
description:
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
(grafted from cf315f485159690eb0e276f76008911152ae8588)
diffstat:
src/tab.js | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r b52610f7f962 -r cc2f70b855d5 src/tab.js
--- a/src/tab.js Mon Jul 08 18:51:36 2019 +0200
+++ b/src/tab.js Mon Jul 08 18:49:22 2019 +0200
@@ -264,7 +264,10 @@
}
tab.tooltip('destroy').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) {
next.find('a').tab('show');
}