events.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. App.Events = (function(lng, undefined) {
  2. lng.dom().ready(function() {
  3. });
  4. //Toggle Aside
  5. //Event on dinamic items
  6. lng.dom('#list-auto').on('swipeLeft', 'li', function(event){
  7. console.error(this, event, 'swipe');
  8. });
  9. //List.Append & List.prepend
  10. lng.dom('#test header a.red').tap(function(event) {
  11. var param = {
  12. el: '#list-added',
  13. template: 'profile-tmp',
  14. data: {
  15. name: 'Javier Jimenez Villar',
  16. description: '@soyjavi'
  17. }
  18. };
  19. if ($$(this).hasClass('prepend')) {
  20. lng.View.Template.List.append(param);
  21. } else {
  22. lng.View.Template.List.prepend(param);
  23. }
  24. });
  25. //Scroll.Append & Scroll.Last // Scroll.first & Scroll.last
  26. lng.dom('#test header a.green').tap(function(event) {
  27. lng.View.Scroll.append('scroll-horizontal', '<span>1</span>');
  28. lng.View.Scroll.first('scroll-horizontal');
  29. lng.View.Scroll.append('scroll-vertical', '<span>1</span>');
  30. lng.View.Scroll.last('scroll-vertical');
  31. });
  32. //Remove Item >> Scroll.refresh
  33. lng.dom('article#list-added li').tap(function(event) {
  34. $$(this).remove();
  35. lng.View.Scroll.refresh('list-added');
  36. });
  37. //SPECIAL
  38. $$('section#test').on('load', function(event) {
  39. console.error('Load #navigation', event);
  40. lng.Router.article('#next', '#files');
  41. });
  42. $$('section#next').on('unload', function(event) {
  43. console.error('Unload', event);
  44. });
  45. })(LUNGO);