events.js 1.5 KB

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