events.notification.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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, 2000);
  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. });