Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

58 wiersze
1.5 KiB

  1. define([
  2. 'js/system/events',
  3. 'html!ui/templates/menu/template',
  4. 'css!ui/templates/menu/styles'
  5. ], function (
  6. events,
  7. template,
  8. styles
  9. ) {
  10. return {
  11. tpl: template,
  12. postRender: function () {
  13. if (isMobile) {
  14. this.el.on('click', this.toggleButtons.bind(this));
  15. this.find('.btnCollapse').on('click', this.toggleButtons.bind(this));
  16. }
  17. this.find('.btnHelp').on('click', this.handler.bind(this, 'onShowHelp'));
  18. this.find('.btnInventory').on('click', this.handler.bind(this, 'onShowInventory'));
  19. this.find('.btnEquipment').on('click', this.handler.bind(this, 'onShowEquipment'));
  20. this.find('.btnOnline').on('click', this.handler.bind(this, 'onShowOnline'));
  21. this.find('.btnLeaderboard').on('click', this.handler.bind(this, 'onShowLeaderboard'));
  22. this.find('.btnReputation').on('click', this.handler.bind(this, 'onShowReputation'));
  23. this.find('.btnMainMenu').on('click', this.handler.bind(this, 'onToggleMainMenu'));
  24. this.find('.btnPassives').on('click', this.handler.bind(this, 'onShowPassives'));
  25. this.onEvent('onGetPassivePoints', this.onGetPassivePoints.bind(this));
  26. },
  27. handler: function (e) {
  28. if (isMobile)
  29. this.el.removeClass('active');
  30. events.emit(e);
  31. return false;
  32. },
  33. onGetPassivePoints: function (points) {
  34. let el = this.find('.btnPassives .points');
  35. el
  36. .html('')
  37. .hide();
  38. if (points > 0) {
  39. el
  40. .html(points)
  41. .show();
  42. }
  43. },
  44. toggleButtons: function (e) {
  45. this.el.toggleClass('active');
  46. e.stopPropagation();
  47. }
  48. };
  49. });