admin
1 week ago
front
1 day ago
actions.js
1 day ago
latecheckbox.js
1 year ago
lateselect.js
1 year ago
notifications.js
1 year ago
shared.js
1 year ago
time.js
1 year ago
notifications.js
19 lines
| 1 | function latepoint_add_notification(message, message_type = 'success'){ |
| 2 | var wrapper = jQuery('body').find('.os-notifications'); |
| 3 | if(!wrapper.length){ |
| 4 | jQuery('body').append('<div class="os-notifications"></div>'); |
| 5 | wrapper = jQuery('body').find('.os-notifications'); |
| 6 | } |
| 7 | if(wrapper.find('.item').length > 0) wrapper.find('.item:first-child').remove(); |
| 8 | wrapper.append('<div class="item item-type-'+ message_type +'">' + message + '<span class="os-notification-close"><i class="latepoint-icon latepoint-icon-x"></i></span></div>'); |
| 9 | } |
| 10 | |
| 11 | function latepoint_add_lightbox_notification(message, message_type = 'success'){ |
| 12 | var wrapper = jQuery('.latepoint-lightbox-content').find('.os-notifications'); |
| 13 | if(!wrapper.length){ |
| 14 | jQuery('.latepoint-lightbox-content').prepend('<div class="os-notifications"></div>'); |
| 15 | wrapper = jQuery('.latepoint-lightbox-content').find('.os-notifications'); |
| 16 | } |
| 17 | if(wrapper.find('.item').length > 0) wrapper.find('.item:first-child').remove(); |
| 18 | wrapper.append('<div class="item item-type-'+ message_type +'">' + message + '<span class="os-notification-close"><i class="latepoint-icon latepoint-icon-x"></i></span></div>'); |
| 19 | } |