diff --git a/modules/addons/dnaextended/assets/module.js b/modules/addons/dnaextended/assets/module.js index 43f9c72..1fd4daa 100755 --- a/modules/addons/dnaextended/assets/module.js +++ b/modules/addons/dnaextended/assets/module.js @@ -1,24 +1,16 @@ /** - * * Created by Bunyamin on 27.07.2017. * Project name kriweb * 27.07.2017 16:02 * Bünyamin AKÇAY */ -let modulename = $('#module-name').val(); -let loadinghtml = '
'+window._lang.loading+'
'; -let currentmodalid=''; - - -let modules = [ - 'domains', - 'settings' -]; -let dt_var = { +const modulename = $('#module-name').val(); +const loadinghtml = `
+ ${window._lang.loading} +
`; +const modules = ['domains', 'settings']; +const dt_var = { dom: '<\'row\'<\'col-sm-6 actionbuttons\'><\'col-sm-6 actionbuttons2\'f>><\'row\'<\'col-sm-12\'r><\'col-sm-12\'t>><\'row\'<\'col-sm-4\'l><\'col-sm-4\'i><\'col-sm-4\'p>>', - //language: { - // "url": "https://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Turkish.json" - //}, processing: true, serverSide: true, searching: true, @@ -27,32 +19,24 @@ let dt_var = { lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]], }; -$(document).ready(function () { - +$(document).ready(() => { if($("#modulebody").find("div").length < 1) { drawlayout('dashboard', {}); } - $.each(modules, function (k, v) { - $('body').append(''); + modules.forEach(module => { + $('body').append(``); }); $(".moduleurl").click(function() { - var target = $(this).attr("data-target"); - - if(target==''){ - return 0; - } - - if($(this).parent("li").hasClass("active")){ - return 0; - } - + const target = $(this).attr("data-target"); + if (target && !$(this).parent("li").hasClass("active")) { $("ul.moduletopbarnav li").removeClass("active"); $(this).parent("li").addClass("active"); drawlayout(target, {}); + } }); $("#whmcsdevbanner").remove(); @@ -60,38 +44,28 @@ $(document).ready(function () { function drawlayout(layout, parameters,conainer='modulebody',viewtype='html') { + const containerSelector = `#${conainer}`; + $(containerSelector).html(loadinghtml); - $('#'+conainer).html(loadinghtml) - - $.post( generateUrl(layout,viewtype), parameters, function (data) { - - $('#'+conainer).html(data); - - - if($('#'+conainer+' .subnav').length>0){ - - $('.module-actions').html('