ui-notific8.js
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var UINotific8 = function () {
return {
//main function to initiate the module
init: function () {
$('#notific8_show').click(function(event) {
var settings = {
theme: $('#notific8_theme').val(),
sticky: $('#notific8_sticky').is(':checked'),
horizontalEdge: $('#notific8_pos_hor').val(),
verticalEdge: $('#notific8_pos_ver').val()
},
$button = $(this);
if ($.trim($('#notific8_heading').val()) != '') {
settings.heading = $.trim($('#notific8_heading').val());
}
if (!settings.sticky) {
settings.life = $('#notific8_life').val();
}
$.notific8('zindex', 11500);
$.notific8($.trim($('#notific8_text').val()), settings);
$button.attr('disabled', 'disabled');
setTimeout(function() {
$button.removeAttr('disabled');
}, 1000);
});
}
};
}();
jQuery(document).ready(function() {
UINotific8.init();
});