first initial
This commit is contained in:
75
public/js/init.js
Normal file
75
public/js/init.js
Normal file
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
function moneyFormat(n, currency) {
|
||||
n = (n != null) ? n : 0;
|
||||
var v = parseFloat(n).toFixed(0);
|
||||
return currency + " " + v.replace(/./g, function (c, i, a) {
|
||||
return i > 0 && c !== "," && (a.length - i) % 3 === 0 ? "." + c : c;
|
||||
});
|
||||
}
|
||||
|
||||
var KTToastr = function () {
|
||||
var successToastr = function (msg, title) {
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"debug": false,
|
||||
"newestOnTop": false,
|
||||
"progressBar": false,
|
||||
"positionClass": "toast-top-right",
|
||||
"preventDuplicates": true,
|
||||
"onclick": null,
|
||||
"showDuration": "500",
|
||||
"hideDuration": "500",
|
||||
"timeOut": "3000",
|
||||
"extendedTimeOut": "3000",
|
||||
"showEasing": "swing",
|
||||
"hideEasing": "swing",
|
||||
"showMethod": "fadeIn",
|
||||
"hideMethod": "fadeOut"
|
||||
};
|
||||
var $toast = toastr["success"](msg, title);
|
||||
|
||||
if (typeof $toast === 'undefined') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var errorToastr = function (msg, title) {
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"debug": false,
|
||||
"newestOnTop": false,
|
||||
"progressBar": false,
|
||||
"positionClass": "toast-top-right",
|
||||
"preventDuplicates": true,
|
||||
"onclick": null,
|
||||
"showDuration": "500",
|
||||
"hideDuration": "500",
|
||||
"timeOut": "3000",
|
||||
"extendedTimeOut": "3000",
|
||||
"showEasing": "swing",
|
||||
"hideEasing": "swing",
|
||||
"showMethod": "fadeIn",
|
||||
"hideMethod": "fadeOut"
|
||||
};
|
||||
var $toast = toastr["error"](msg, title);
|
||||
|
||||
if (typeof $toast === 'undefined') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
initSuccess: function (msg, title) {
|
||||
successToastr(msg, title);
|
||||
},
|
||||
initError: function (msg, title) {
|
||||
errorToastr(msg, title);
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
var li = $('.kt-menu__item--active');
|
||||
li.closest('li.kt-menu__item--submenu').addClass('kt-menu__item--open');
|
||||
});
|
||||
Reference in New Issue
Block a user