2024-05-09 11:16:07 +07:00
"use strict" ;
const AdminFunction = ( ( ) => {
2024-05-11 10:11:24 +07:00
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" ) ;
2024-05-10 23:25:07 +07:00
}
2024-05-11 10:11:24 +07:00
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 ) ;
} ;
}
function t ( t ) {
$ ( "#status_" + t ) . html ( '<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>' ) , 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 ( '<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Đang xử lý..</span>' ) , setTimeout ( ( ) => {
$ ( "#js-status-hottype-" + e ) . html ( "" ) ;
} , 1e3 ) ;
}
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" ) ;
}
2025-02-11 16:22:18 +07:00
return { capNhatTrangThaiMenu : capNhatTrangThaiMenu , add _product _to _category : t , run _search : n , update _product _hot : o , checkForm : i , closeForm : r } ;
2024-05-10 23:25:07 +07:00
} ) ( ) ;
2025-12-04 17:20:42 +07:00
new Choices ( "#group-select" ) ;