You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
566 B

  1. define([
  2. 'js/system/events',
  3. 'html!ui/templates/help/template',
  4. 'css!ui/templates/help/styles'
  5. ], function (
  6. events,
  7. template,
  8. styles
  9. ) {
  10. return {
  11. tpl: template,
  12. centered: true,
  13. modal: true,
  14. postRender: function () {
  15. this.onEvent('onKeyDown', this.onKeyDown.bind(this));
  16. this.onEvent('onShowHelp', this.toggle.bind(this));
  17. },
  18. onKeyDown: function (key) {
  19. if (key == 'h')
  20. this.toggle();
  21. },
  22. toggle: function () {
  23. this.shown = !this.el.is(':visible');
  24. if (this.shown)
  25. this.show();
  26. else
  27. this.hide();
  28. }
  29. };
  30. });