events.js 1.7 KB

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