const Resource = { init() { this.leftMenuClick() this.downloadEvent() this.formSubmitEvent() }, leftMenuClick() { $("#category").on("click", "li a", (e) => { const className = $(e.target).attr('class').split(" ")[0] if (className.includes('content-')) { var temp = className.split('-') temp.pop() temp = '.' + temp.join("-") console.log(temp) $(temp).siblings().removeClass("show") $(temp).addClass("show") } }) }, downloadEvent() { $("#download-btn").click(() => { $("#download-email-dialog").removeClass("dialog-hide") $(".dialog-mask").removeClass("dialog-hide") }) }, formSubmitEvent() { $("#downloadFormBtn").click(() => { alert(1) Self.formAjax({ email: '#formEmail', content: '#formMessage' }, 'download', this.fileDialogShow) }) }, fileDialogShow() { $("#download-email-dialog").addClass("dialog-hide") $("#download-file-dialog").removeClass("dialog-hide") } } Resource.init()