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
616 B

  1. define([
  2. 'html!./template',
  3. 'css!./styles',
  4. 'js/generator',
  5. 'js/client'
  6. ], function (
  7. template,
  8. styles,
  9. generator,
  10. client
  11. ) {
  12. return {
  13. tpl: template,
  14. modal: true,
  15. centered: true,
  16. postRender: function () {
  17. this.find('input').focus();
  18. this.on('.btnSave', 'click', this.actions.onSave.bind(this));
  19. var loaded = $('.uiMenu').data('ui').loaded;
  20. if (loaded)
  21. this.find('.fileName').val(loaded);
  22. },
  23. actions: {
  24. onSave: function () {
  25. var fileName = this.val('.fileName');
  26. var data = generator.serialize();
  27. client.save(fileName, data);
  28. this.destroy();
  29. }
  30. }
  31. }
  32. });