define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) { var Controller = { index: function () { Controller.api.bindevent(); var agent_mode = $('#c-agent_mode').val(); if(agent_mode == 1)$('.item2').css('display', 'none'); if(agent_mode == 2)$('.item2').css('display', 'block'); $(document).on("change", "#c-agent_mode", function () { var value = $(this).val(); if(value == 1){ $('.item2').css('display', 'none'); }else{ $('.item2').css('display', 'block'); } }); $(".nav-item").each(function () { $(this).click(function () { $(this).addClass('active').siblings().removeClass("active"); $(".tab").css('display', 'none'); var className = $(this).attr('data-class'); $('.'+className).css('display','block'); }); }); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });