events.notification.js 2.1 KB

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