events-oldschool.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. LUNGO.Events.init({
  2. 'section#sec-1 header #btn-toggle-loading tap': App.View.toggleLoading,
  3. 'section#sec-1 load': function(event) {
  4. console.error('section#sec-1 loaded', event);
  5. console.error('current section', lng.Element.Current.section);
  6. LUNGO.Router.article('sec-1', 'nav-2');
  7. },
  8. 'a': App.View.toggleLoading
  9. });
  10. /*
  11. App.Events = (function(lng, undefined) {
  12. lng.ready(function() {
  13. //lng.View.Aside.toggle('.right');
  14. setTimeout(function() {
  15. lng.View.Element.progress('#progress-normal', 50, true, 'yeah');
  16. lng.View.Element.progress('#progress-big', 75, true, 'yeah');
  17. lng.View.Element.loading('#loading-code', 'white');
  18. }, 1000);
  19. });
  20. $$('section#sec-1 header #btn-toggle-loading').tap(function(event) {
  21. var el = lng.dom(this);
  22. if (el.children('.loading').length > 0) {
  23. el.children('.icon').show();
  24. lng.View.Element.loading(this);
  25. } else {
  26. el.children('.icon').hide();
  27. lng.View.Element.loading(this, 'white');
  28. }
  29. });
  30. //SPECIAL
  31. $$('section#sec-1').on('load', function(event) {
  32. console.error('section#sec-1 loaded', event);
  33. console.error('current section', lng.Element.Current.section);
  34. lng.Router.article('sec-1', 'nav-2');
  35. });
  36. $$('section#sec-2').on('unload', function(event) {
  37. console.error('section#sec-2 unloaded', event);
  38. });
  39. $$('section#sec-2').on('load', function(event) {
  40. console.error('section#sec-2 loaded', event);
  41. });
  42. $$('article#nav-1').on('load', function(event) {
  43. console.error('article#nav-1 loaded', event);
  44. });
  45. $$('article#nav-3').on('unload', function(event) {
  46. console.error('article#nav-1 unloaded', event);
  47. });
  48. return {
  49. a: a
  50. };
  51. })(LUNGO);
  52. */