You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
602 B
35 lines
602 B
var notify = (function () {
|
|
var nt = {};
|
|
var sel = '#notif';
|
|
|
|
var hideTmeo1;
|
|
var hideTmeo2;
|
|
|
|
nt.show = function (message, timeout) {
|
|
$(sel).html(message);
|
|
modal.show(sel);
|
|
|
|
clearTimeout(hideTmeo1);
|
|
clearTimeout(hideTmeo2);
|
|
|
|
if (!_.isUndefined(timeout)) {
|
|
hideTmeo1 = setTimeout(nt.hide, timeout);
|
|
}
|
|
};
|
|
|
|
nt.hide = function () {
|
|
var $m = $(sel);
|
|
$m.removeClass('visible');
|
|
hideTmeo2 = setTimeout(function () {
|
|
$m.addClass('hidden');
|
|
}, 250); // transition time
|
|
};
|
|
|
|
nt.init = function() {
|
|
$(sel).on('click', function() {
|
|
nt.hide(this);
|
|
});
|
|
};
|
|
|
|
return nt;
|
|
})();
|
|
|