選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

34 行
671 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. postRender: function () {
  15. this.on('.btnLoad', 'click', this.events.onLoad.bind(this));
  16. this.on('.btnSave', 'click', this.events.onSave.bind(this));
  17. },
  18. events: {
  19. onLoad: function () {
  20. var fileName = this.val('.fileName');
  21. client.load(fileName, generator.actions.load.bind(generator));
  22. },
  23. onSave: function () {
  24. var fileName = this.val('.fileName');
  25. var data = generator.serialize();
  26. client.save(fileName, data, generator.actions.load.bind(generator));
  27. }
  28. }
  29. }
  30. });