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.
 
 
 

31 lines
493 B

  1. define([
  2. 'html!./template',
  3. 'css!./styles',
  4. 'js/generator'
  5. ], function (
  6. template,
  7. styles,
  8. generator
  9. ) {
  10. return {
  11. tpl: template,
  12. loaded: null,
  13. postRender: function () {
  14. this.on('.btn', 'click', this.events.onChangeMode.bind(this));
  15. },
  16. events: {
  17. onChangeMode: function (event, e) {
  18. var el = $(e.currentTarget);
  19. this.find('.active').removeClass('active');
  20. el.addClass('active');
  21. var mode = el.attr('mode');
  22. generator.setMode(mode);
  23. }
  24. }
  25. }
  26. });