ws-notify.js 523 B

1234567891011121314151617181920212223
  1. "use strict";
  2. (function($) {
  3. $(document).ready(function() {
  4. console.log('ws: init notify');
  5. var $notification = $('#notification');
  6. _ws.notify = function(type, text) {
  7. $notification
  8. .removeClass('success error')
  9. .addClass(type)
  10. .addClass('active');
  11. $notification.html(text);
  12. setTimeout(function() {
  13. $notification.removeClass('active');
  14. }, 2000);
  15. setTimeout(function() {
  16. $notification.removeClass(type);
  17. }, 3000);
  18. }
  19. });
  20. })(jQuery);