u
This commit is contained in:
32
assets/typescript/main.ts
Normal file
32
assets/typescript/main.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
interface AdminFunctions {
|
||||
addProductToCategory(productId: string): void;
|
||||
markProductAsHot(productId: string): void;
|
||||
}
|
||||
|
||||
const AdminFunctions: AdminFunctions = (() => {
|
||||
|
||||
function addProductToCategory(productId: string): void {
|
||||
const statusElement = $('#status_' + productId);
|
||||
statusElement.html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Processing...</span>');
|
||||
setTimeout(() => {
|
||||
statusElement.html('');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function markProductAsHot(productId: string): void {
|
||||
const statusElement = $('#js-status-hottype-' + productId);
|
||||
statusElement.html('<span class="loading loading-bars loading-sm"></span><span class="ml-[3px]">Processing...</span>');
|
||||
setTimeout(() => {
|
||||
statusElement.html('');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
return {
|
||||
addProductToCategory,
|
||||
markProductAsHot
|
||||
};
|
||||
})();
|
||||
|
||||
export default AdminFunctions;
|
||||
Reference in New Issue
Block a user