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.
 
 
 

40 lines
654 B

  1. define([
  2. 'html!./template',
  3. 'css!./styles',
  4. 'js/events'
  5. ], function (
  6. template,
  7. styles,
  8. events
  9. ) {
  10. return {
  11. tpl: template,
  12. modal: true,
  13. centered: true,
  14. postRender: function () {
  15. this.find('input').focus();
  16. this.onEvent('onRenameGroup', this.events.onRenameGroup.bind(this));
  17. },
  18. actions: {
  19. onOk: function (callback) {
  20. var groupName = this.val('.groupName');
  21. this.destroy();
  22. callback(groupName);
  23. }
  24. },
  25. events: {
  26. onRenameGroup: function (oldName, callback) {
  27. if (oldName)
  28. this.find('input').val(oldName);
  29. this.on('.btnOk', 'click', this.actions.onOk.bind(this, callback));
  30. }
  31. }
  32. }
  33. });