fix: biz tab close 반영

main
Jonguk. Lim 2 years ago
parent 5abe9c8916
commit add52d0a1d

@ -86,6 +86,7 @@
<script defer src="${pageContext.request.contextPath}/resources/biz/common/js/contentTabs.js"></script> <script defer src="${pageContext.request.contextPath}/resources/biz/common/js/contentTabs.js"></script>
<script defer type="text/javascript"> <script defer type="text/javascript">
//document.domain = "xit.com";
$(document).ready(() => { $(document).ready(() => {
$('#ifrTabs').tabs({ $('#ifrTabs').tabs({

@ -1,10 +1,7 @@
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
***************************************************************************/ ***************************************************************************/
const menuTab = null, const iframeMap = {},
menuScrollable = null,
iframeMap = {},
menuTabScrollable = null
openMax = 6; openMax = 6;
function openMenu(menuId, menuNm, menuUrl) { function openMenu(menuId, menuNm, menuUrl) {
@ -54,11 +51,8 @@ function openMenu(menuId, menuNm, menuUrl) {
; ;
//$("#content").append($iframe); //$("#content").append($iframe);
//$("#ifrTabs").tabs('option', 'active');
$("#tab-" + menuId).append($iframe); $("#tab-" + menuId).append($iframe);
iframeMap[menuId] = $iframe; iframeMap[menuId] = $iframe;
} }
@ -66,8 +60,6 @@ function closeTab(menuId, selTab) {
if(menuId === 'main' || menuId?.id === 'main') return; if(menuId === 'main' || menuId?.id === 'main') return;
const num_tabs = $('div#ifrTabs ul li.tab').length; const num_tabs = $('div#ifrTabs ul li.tab').length;
const iframe = iframeMap[menuId];
let activeTab = $("#ifrTabs").tabs('option', 'active'); let activeTab = $("#ifrTabs").tabs('option', 'active');
if(num_tabs - 1 > activeTab){ if(num_tabs - 1 > activeTab){
@ -76,12 +68,10 @@ function closeTab(menuId, selTab) {
$('#ifrTabs').tabs({active: activeTab - 1}) $('#ifrTabs').tabs({active: activeTab - 1})
} }
iframeMap[menuId].remove(); iframeMap[menuId].remove();
delete iframeMap[menuId]; delete iframeMap[menuId];
$("#tab-" + activeTab).remove(); $("#tab-" + activeTab).remove();
$('#ifrTabs').find('#li-'+menuId).remove(); $('#ifrTabs').find('#li-'+menuId).remove();
$('#ifrTabs').tabs("refresh"); $('#ifrTabs').tabs("refresh");
} }

Loading…
Cancel
Save