diff --git a/assets/script/global.js b/assets/script/global.js index 7a2138c..0ae932a 100644 --- a/assets/script/global.js +++ b/assets/script/global.js @@ -1,43 +1,43 @@ "use strict"; const AdminFunction = (() => { - function e(e, t, n) { - let o = null; - return function (...a) { - const i = this, - r = function () { - o = null, !n && e.apply(i, a) - }; - const c = n && !o; - clearTimeout(o), o = setTimeout(r, t), c && e.apply(i, a) - } + function capNhatTrangThaiMenu(e) { + !1 === e ? $("#js-admin-content-container").addClass("show-large-menu") : $("#js-admin-content-container").removeClass("show-large-menu"), $("#js-menu-big").toggleClass("hidden", e), $("#js-menu-small").toggleClass("hidden", !e), $("#js-form-search").toggleClass("menu-hide", e), localStorage.setItem(e ? "menu_big" : "menu_small", "hidden"), localStorage.removeItem(e ? "menu_small" : "menu_big"); } - - function t(e) { - $("#js-admin-content-container").toggleClass("show-large-menu", !e), $("#js-menu-big").toggleClass("hidden", e), $("#js-menu-small").toggleClass("hidden", !e), $("#js-form-search").toggleClass("menu-hide", e), localStorage.setItem(e ? "menu_big" : "menu_small", "hidden"), localStorage.removeItem(e ? "menu_small" : "menu_big") + function e(e) { + let t = null; + return function (...n) { + const o = this, a = function () { + t = null, n.length > 0 && !e && func.apply(o, n); + }, i = e && !t; + clearTimeout(t), t = setTimeout(a, wait), i && func.apply(o, n); + }; } - return { - capNhatTrangThaiMenu: t, - add_product_to_category: function (e) { - $("#status_" + e).html('Đang xử lý..'), setTimeout(() => { - $("#status_" + e).html("") - }, 1e3) - }, - run_search: function (e) { - $(e).keyup(e => { - ! function (e) { - $("#js-show-search").show() - }(e.target) - }), $("body").click(() => { - $("#js-show-search").hide() - }) - }, - update_product_hot: function (e) { - $("#js-status-hottype-" + e).html('Đang xử lý..'), setTimeout(() => { - $("#js-status-hottype-" + e).html("") - }, 1e3) - }, - searchSelect: function (e) { - $(e).select2() - } + function t(t) { + $("#status_" + t).html('Đang xử lý..'), setTimeout(() => { + $("#status_" + t).html(""); + }, 1e3); } + function n(e) { + $(e).keyup((() => { + $("#js-show-search").show(); + })); + $("body").click((() => { + $("#js-show-search").hide(); + })); + } + function o(e) { + $("#js-status-hottype-" + e).html('Đang xử lý..'), setTimeout(() => { + $("#js-status-hottype-" + e).html(""); + }, 1e3); + } + function a(e) { + $(e).select2(); + } + function i(e) { + $("#overlay").addClass("active"), $(".status-notificatiom").addClass("active"), !0 === e ? $(".status-notificatiom .content").html(' Cập nhật thành công\n
Đơn hàng #000-368 đã được cập nhật thành công
') : $(".status-notificatiom .content").html(' Lỗi cập nhậtCó một số vấn đề với hoạt động của bạn.
'); + } + function r() { + $("#overlay").removeClass("active"), $(".status-notificatiom").removeClass("active"); + } + return { capNhatTrangThaiMenu: capNhatTrangThaiMenu, add_product_to_category: t, run_search: n, update_product_hot: o, searchSelect: a, checkForm: i, closeForm: r }; })(); diff --git a/template/product/form_components/basic.html b/template/product/form_components/basic.html index 6a0510d..eb6cf4e 100644 --- a/template/product/form_components/basic.html +++ b/template/product/form_components/basic.html @@ -305,6 +305,6 @@