events.notification.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Lungo.Events.init({
  2. 'tap section#notification a[data-action=normal]': function() {
  3. Lungo.Notification.show('Title', 'message', 2);
  4. },
  5. 'tap section#notification a[data-action=loading]': function() {
  6. Lungo.Notification.show();
  7. setTimeout(Lungo.Notification.hide, 3000);
  8. },
  9. 'tap section#notification a[data-action=success]': function() {
  10. Lungo.Notification.success('Title', 'Description', 'message', 2);
  11. },
  12. 'tap section#notification a[data-action=error]': function() {
  13. Lungo.Notification.error('Title', 'Description', 'message', 2);
  14. },
  15. 'tap section#notification a[data-action=confirm]': function() {
  16. Lungo.Notification.confirm({
  17. title: 'Title',
  18. description: 'Description',
  19. icon: 'message',
  20. accept: {
  21. color: 'blue',
  22. icon: 'checkmark',
  23. label: 'Yes',
  24. callback: function(){ alert("Yes!"); }
  25. },
  26. cancel: {
  27. icon: 'close',
  28. label: 'No',
  29. callback: function(){ alert("No!"); }
  30. }
  31. });
  32. },
  33. 'tap section#notification a[data-action=html]': function() {
  34. Lungo.Notification.html('<h1>Hello World</h1>', true);
  35. },
  36. 'tap section#notification a[data-action=chaining]': function() {
  37. Lungo.Notification.show('Title', 'message', 2, function() {
  38. Lungo.Notification.error('Title 2', 'Description 2', 'message', 2, function() {
  39. Lungo.Notification.show('Title 3', 'Description 3', 'message', false, 2, function() {
  40. Lungo.Notification.html('<h1>Hello World</h1>', true);
  41. // Lungo.Notification.hide();
  42. });
  43. });
  44. });
  45. }
  46. });