js
This commit is contained in:
@@ -1,43 +1,43 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
const AdminFunction = (() => {
|
const AdminFunction = (() => {
|
||||||
function e(e, t, n) {
|
function capNhatTrangThaiMenu(e) {
|
||||||
let o = null;
|
!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");
|
||||||
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 e(e) {
|
||||||
function t(e) {
|
let t = null;
|
||||||
$("#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")
|
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 {
|
function t(t) {
|
||||||
capNhatTrangThaiMenu: t,
|
$("#status_" + t).html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), setTimeout(() => {
|
||||||
add_product_to_category: function (e) {
|
$("#status_" + t).html("");
|
||||||
$("#status_" + e).html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), setTimeout(() => {
|
}, 1e3);
|
||||||
$("#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('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), setTimeout(() => {
|
|
||||||
$("#js-status-hottype-" + e).html("")
|
|
||||||
}, 1e3)
|
|
||||||
},
|
|
||||||
searchSelect: function (e) {
|
|
||||||
$(e).select2()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
function n(e) {
|
||||||
|
$(e).keyup((() => {
|
||||||
|
$("#js-show-search").show();
|
||||||
|
}));
|
||||||
|
$("body").click((() => {
|
||||||
|
$("#js-show-search").hide();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function o(e) {
|
||||||
|
$("#js-status-hottype-" + e).html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>'), 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('<i class="fa fa-check"></i> <b>Cập nhật thành công</b>\n <p>Đơn hàng #000-368 đã được cập nhật thành công</p>') : $(".status-notificatiom .content").html('<i class="fa-solid fa-triangle-exclamation"></i> <b>Lỗi cập nhật</b><p>Có một số vấn đề với hoạt động của bạn.</p>');
|
||||||
|
}
|
||||||
|
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 };
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -305,6 +305,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bg-white p-[15px] border-[#FAFAFB] rounded-[0_0_10px_10px] shadow-[0_1px_1px_0px_#0000001A]">
|
<div class="bg-white p-[15px] border-[#FAFAFB] rounded-[0_0_10px_10px] shadow-[0_1px_1px_0px_#0000001A]">
|
||||||
<input class="w-[82px] h-[32px] bg-[#0041E8] rounded-[4px] text-white cursor-pointer" id="submit-collection-btn"
|
<input class="w-[82px] h-[32px] bg-[#0041E8] rounded-[4px] text-white cursor-pointer" id="submit-collection-btn"
|
||||||
name="commit" type="submit" value="Cập nhật" />
|
name="commit" type="button" value="Cập nhật" onclick="AdminFunction.checkForm(true)" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="overlay"></div>
|
||||||
|
|
||||||
<div class="admin-global-container">
|
<div class="admin-global-container">
|
||||||
|
|
||||||
@@ -297,13 +297,26 @@
|
|||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
{{ page_content }}
|
{{ page_content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="status-notificatiom">
|
||||||
|
<a href="javascript:void(0)" class="icon-close" onclick="AdminFunction.closeForm()"><i
|
||||||
|
class="fa fa-times"></i></a>
|
||||||
|
<div class="content flex flex-col items-center justify-center">
|
||||||
|
<i class="fa fa-check"></i>
|
||||||
|
<b>Cập nhật thành công</b>
|
||||||
|
<p>Đơn hàng #000-368 đã được cập nhật thành công</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/datepicker.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/datepicker.min.js"></script>
|
||||||
<script src="{{ 'global.js' | asset_url }}"></script>
|
<script src="{{ 'global.js' | asset_url }}?v=1"></script>
|
||||||
<!-- <script src="../dist/index.js"></script> -->
|
<!-- <script src="../dist/index.js"></script> -->
|
||||||
{% include javascript/index %}
|
{% include javascript/index %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user