events.js 1.6 KB

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