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.
 
 
 

32 lines
497 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. modal: true,
  13. centered: true,
  14. postRender: function () {
  15. this.on('.btnImport', 'click', this.events.onImport.bind(this));
  16. },
  17. events: {
  18. onImport: function () {
  19. var val = this.find('textarea').val();
  20. try {
  21. var data = JSON.parse(val);
  22. generator.callAction('load', data);
  23. this.destroy();
  24. } catch (e) {}
  25. }
  26. }
  27. }
  28. });