events.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. App.Events = (function(lng, undefined) {
  2. lng.ready(function() {
  3. App.Services.mockProfiles();
  4. lng.View.Aside.show('#kitchen-sink', '#kitchen-sink-scroll');
  5. lng.View.Element.progress('.progress', 10, true, 'Downloading 1/5...');
  6. });
  7. lng.dom('#event_touchstart').touch(function(event) { alert("touchstart!"); });
  8. //OR
  9. //lng.dom('#event_touchstart').on('touchstart', function(event) { alert("TOUCH_START!"); });
  10. lng.dom('#event_touchend').on('touchend', function(event) { alert("touchend!"); });
  11. lng.dom('#event_touchmove').on('touchmove' , function(event) { alert("touchmove!"); });
  12. //Tap Methods
  13. lng.dom('#event_tap').tap(function(event) { alert("tap!"); });
  14. //OR
  15. //lng.dom('#event_tap').on('tap', function(event) { alert("TAP!"); });
  16. lng.dom('#event_doubletap').doubleTap(function(event) { alert("doubleTap!"); });
  17. lng.dom('#event_longtap').longTap(function(event) { alert("longTap!"); });
  18. //Swipe Methods
  19. lng.dom('#swipe').swipe(function(event) { alert("swipe!"); });
  20. lng.dom('#swipe_left').swipeLeft(function(event) { alert("swipeLeft!"); });
  21. lng.dom('#swipe_right').swipeRight(function(event) { alert("swipeRight!"); });
  22. lng.dom('#swipe_up').swipeUp(function(event) { alert("swipeUp!"); });
  23. lng.dom('#swipe_down').swipeDown(function(event) { alert("swipeDown!"); });
  24. lng.dom('a[href="#scrolls"]').on('tap', function(event) {
  25. App.View.mockScrolls();
  26. });
  27. lng.dom('section#navigation-index article a').tap(function(event) {
  28. var type_of_transition = lng.dom(this).attr('class') || 'normal';
  29. lng.dom('section#navigation-index').removeClass('pop').removeClass('flow').addClass(type_of_transition);
  30. setTimeout(function() {
  31. lng.Router.section('navigation-' + type_of_transition);
  32. }, 100);
  33. });
  34. //List.Append & List.prepend
  35. lng.dom('section#lists header .onright a').tap(function(event) {
  36. var param = {
  37. el: '#list-dinamic',
  38. template: 'profile-tmp',
  39. data: {
  40. name: 'Dinamic item list',
  41. description: '@soyjavi'
  42. }
  43. };
  44. if ($$(this).hasClass('prepend')) {
  45. lng.View.Template.List.append(param);
  46. } else {
  47. lng.View.Template.List.prepend(param);
  48. }
  49. });
  50. })(LUNGO);