|
|
@ -35,33 +35,34 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function addMenu(menus, level, id) { |
|
|
|
function addMenu(menus) { |
|
|
|
|
|
|
|
|
|
|
|
for (var menu in menus) { |
|
|
|
for (var menu in menus) { |
|
|
|
href = menus[menu].href; |
|
|
|
id = menus[menu].id; |
|
|
|
menuId = '#menu' + menus[menu].id; |
|
|
|
menuId = '#menu' + id; |
|
|
|
$("#list-tab").append('<a class="list-group-item list-group-item-action" data-href="' + menus[menu].href + '" data-id="' + menus[menu].id + '" id="' + menuId.substr(1) + '" data-toggle="list">\n' + |
|
|
|
$("#list-tab").append('<a class="list-group-item list-group-item-action" id="' + menuId.substr(1) + '" data-toggle="list" data-href="'+menus[menu].href+'">\n' + |
|
|
|
' ' + menus[menu].menuName + '\n' + |
|
|
|
' <span class="d-inline-block col-6 text-right">' + menus[menu].menuName + '</span>\n' + |
|
|
|
' </a>'); |
|
|
|
' </a>'); |
|
|
|
if (level > 0) { |
|
|
|
if (menus[menu].menuLevel > 0) { |
|
|
|
$(menuId).addClass('offset-' + level).addClass('menu' + id); |
|
|
|
$(menuId).addClass('offset-' + menus[menu].menuLevel).addClass('menu' + menus[menu].parentId); |
|
|
|
$(menuId).hide(); |
|
|
|
$(menuId).hide(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (menus[menu].childMenu.length > 0) { |
|
|
|
if (menus[menu].childMenu.length > 0) { |
|
|
|
$(menuId).append('<i class="fas fa-angle-right"></i><span class="badge badge-primary badge-pill offset-8">' + menus[menu].childMenu.length + '</span>').click(showMenu); |
|
|
|
$(menuId).append('<i class="fas fa-angle-right"></i><span class="badge badge-primary badge-pill offset-8">' + menus[menu].childMenu.length + '</span>').click(showMenu); |
|
|
|
addMenu(menus[menu].childMenu, level + 1, menus[menu].id); |
|
|
|
addMenu(menus[menu].childMenu,menus[menu].href); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
// $(menuId+'>span:last').append('<i class="fas fa-adjust"></i>'); |
|
|
|
$(menuId).click(function () { |
|
|
|
$(menuId).click(function () { |
|
|
|
btnId = '#btn' + $(this).data('id'); |
|
|
|
btnId = '#btn' + $(this).attr('id'); |
|
|
|
if ($(btnId).length == 0) { |
|
|
|
if ($(btnId).length == 0) { |
|
|
|
$("#tabs").append('<button type="button" id="' + btnId.substr(1) + '" class="btn btn-secondary btn-lg" data-id="'+$(this).data('id')+'" href="#iframe' + $(this).data('id') + '">' + $(this).text() + '\n' + |
|
|
|
$("#tabs").append('<button type="button" id="' + btnId.substr(1) + '" class="btn btn-secondary btn-lg" data-id="' + $(this).attr('id') + '" href="#iframe' + $(this).attr('id') + '">' + $(this).text() + '\n' + |
|
|
|
' <i class="fas fa-times" style="display: none"></i>\n' + |
|
|
|
' <i class="fas fa-times" style="display: none"></i>\n' + |
|
|
|
' </button>') |
|
|
|
' </button>') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$(btnId).click(); |
|
|
|
$(btnId).click(); |
|
|
|
|
|
|
|
|
|
|
|
iframe = '#iframe' + $(this).data('id'); |
|
|
|
iframe = '#iframe' + $(this).attr('id'); |
|
|
|
if ($(iframe).length == 0) { |
|
|
|
if ($(iframe).length == 0) { |
|
|
|
$(top.document).find('#nav-tabContent').append('<div id="' + iframe.substr(1) + '" class="tab-pane fade embed-responsive embed-responsive-16by9" >\n' + |
|
|
|
$(top.document).find('#nav-tabContent').append('<div id="' + iframe.substr(1) + '" class="tab-pane fade embed-responsive embed-responsive-16by9" >\n' + |
|
|
|
' <iframe class="embed-responsive-item" src="' + $(this).data('href') + '"></iframe>\n' + |
|
|
|
' <iframe class="embed-responsive-item" src="' + $(this).data('href') + '"></iframe>\n' + |
|
|
@ -76,9 +77,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$(function () { |
|
|
|
$(function () { |
|
|
|
addMenu(${menus}.data, 0 |
|
|
|
addMenu(${menus}['data']); |
|
|
|
) |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
</head> |
|
|
|
</head> |
|
|
|