|
|
|
@ -60,18 +60,38 @@ function closeTab(menuId, selTab) {
|
|
|
|
|
if(menuId === 'main' || menuId?.id === 'main') return;
|
|
|
|
|
const num_tabs = $('div#ifrTabs ul li.tab').length;
|
|
|
|
|
|
|
|
|
|
let activeTab = $("#ifrTabs").tabs('option', 'active');
|
|
|
|
|
// click한 tab
|
|
|
|
|
const selIdx = id2Index("div#ifrTabs","#tab-"+menuId);
|
|
|
|
|
|
|
|
|
|
if(num_tabs - 1 > activeTab){
|
|
|
|
|
$('#ifrTabs').tabs({active: activeTab + 1})
|
|
|
|
|
}else{
|
|
|
|
|
$('#ifrTabs').tabs({active: activeTab - 1})
|
|
|
|
|
// active tab
|
|
|
|
|
let activeIdx = $("#ifrTabs").tabs('option', 'active');
|
|
|
|
|
|
|
|
|
|
if(selIdx === activeIdx) {
|
|
|
|
|
if (num_tabs - 1 > activeIdx) {
|
|
|
|
|
$('#ifrTabs').tabs({active: activeIdx + 1})
|
|
|
|
|
} else {
|
|
|
|
|
$('#ifrTabs').tabs({active: activeIdx - 1})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iframeMap[menuId].remove();
|
|
|
|
|
delete iframeMap[menuId];
|
|
|
|
|
|
|
|
|
|
$("#tab-" + activeTab).remove();
|
|
|
|
|
$("#tab-" + activeIdx).remove();
|
|
|
|
|
$('#ifrTabs').find('#li-'+menuId).remove();
|
|
|
|
|
$('#ifrTabs').tabs("refresh");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function id2Index(tabsId, srcId) {
|
|
|
|
|
let index = -1;
|
|
|
|
|
const tbH = $(tabsId).find("li a");
|
|
|
|
|
if(tbH.length > 0) {
|
|
|
|
|
tbH.each((idx, liEl) => {
|
|
|
|
|
if (liEl.href.search(srcId) > 0) {
|
|
|
|
|
index = idx;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return index;
|
|
|
|
|
}
|