|
|
|
@ -17,11 +17,11 @@ function openMenu(obj, params) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const OPEN_TAB_CNT = $('div#ifrTabs > ul > li').length;
|
|
|
|
|
const OPEN_TAB_CNT = $('div#tabsForInnerPage > ul > li').length;
|
|
|
|
|
|
|
|
|
|
if(innerPageMap[dataKey]){
|
|
|
|
|
// 해당 tab 활성화
|
|
|
|
|
$("#ifrTabs").find("ul li button.nav-link").each((idx, data) => {
|
|
|
|
|
$("#tabsForInnerPage").find("ul li button.nav-link").each((idx, data) => {
|
|
|
|
|
if(data.dataset.bsTarget == ("#tab-"+dataKey)) {
|
|
|
|
|
$(data).trigger("click");
|
|
|
|
|
}
|
|
|
|
@ -48,7 +48,7 @@ function openMenu(obj, params) {
|
|
|
|
|
liEl += '<button type="button" title="닫기" class="btn btn-close" onclick="closeTab('+ dataKey + ')"></button>'
|
|
|
|
|
}
|
|
|
|
|
liEl += '</li>';
|
|
|
|
|
$('div#ifrTabs ul').append(liEl);
|
|
|
|
|
$('div#tabsForInnerPage ul').append(liEl);
|
|
|
|
|
|
|
|
|
|
$('div#ifrTabContents').append('<div id="tab-' + dataKey + '" class="tab-pane"></div>');
|
|
|
|
|
|
|
|
|
@ -77,7 +77,7 @@ function openMenu(obj, params) {
|
|
|
|
|
|
|
|
|
|
innerPageMap[dataKey] = $dynamicPage;
|
|
|
|
|
|
|
|
|
|
$("div#ifrTabs ul li button.nav-link").last().trigger("click");
|
|
|
|
|
$("div#tabsForInnerPage ul li button.nav-link").last().trigger("click");
|
|
|
|
|
|
|
|
|
|
let dynamicPageObj = document.getElementById(dataKey);
|
|
|
|
|
return dynamicPageObj;
|
|
|
|
@ -85,21 +85,21 @@ function openMenu(obj, params) {
|
|
|
|
|
|
|
|
|
|
function closeTab(menuId) {
|
|
|
|
|
if(menuId === 'main' || menuId?.id === 'main') return;
|
|
|
|
|
const num_tabs = $('div#ifrTabs ul li').length;
|
|
|
|
|
const num_tabs = $('div#tabsForInnerPage ul li').length;
|
|
|
|
|
|
|
|
|
|
// click한 tab
|
|
|
|
|
const selIdx = id2Index("div#ifrTabs","tab-"+menuId);
|
|
|
|
|
const selIdx = id2Index("div#tabsForInnerPage","tab-"+menuId);
|
|
|
|
|
|
|
|
|
|
// active tab
|
|
|
|
|
let activeTab = $('div#ifrTabs ul li button.nav-link').filter(".active");
|
|
|
|
|
let activeTab = $('div#tabsForInnerPage ul li button.nav-link').filter(".active");
|
|
|
|
|
|
|
|
|
|
let activeIdx = $('div#ifrTabs ul li button.nav-link').index(activeTab);
|
|
|
|
|
let activeIdx = $('div#tabsForInnerPage ul li button.nav-link').index(activeTab);
|
|
|
|
|
|
|
|
|
|
if(selIdx === activeIdx) {
|
|
|
|
|
if (num_tabs - 1 > activeIdx) {
|
|
|
|
|
$('div#ifrTabs ul li button.nav-link').eq(activeIdx + 1).trigger("click");
|
|
|
|
|
$('div#tabsForInnerPage ul li button.nav-link').eq(activeIdx + 1).trigger("click");
|
|
|
|
|
} else {
|
|
|
|
|
$('div#ifrTabs ul li button.nav-link').eq(activeIdx - 1).trigger("click");
|
|
|
|
|
$('div#tabsForInnerPage ul li button.nav-link').eq(activeIdx - 1).trigger("click");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -107,7 +107,7 @@ function closeTab(menuId) {
|
|
|
|
|
delete innerPageMap[menuId];
|
|
|
|
|
|
|
|
|
|
$("#tab-" + activeIdx).remove();
|
|
|
|
|
$('#ifrTabs').find('#li-'+menuId).remove();
|
|
|
|
|
$('#tabsForInnerPage').find('#li-'+menuId).remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function id2Index(tabsId, srcId) {
|