redo.js 905 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @fileoverview
  3. * Tool 'Redo' Source,
  4. * Class Trex.Tool.ReDo 와 configuration을 포함
  5. *
  6. */
  7. TrexConfig.addTool(
  8. "redo",
  9. {
  10. sync: _FALSE,
  11. status: _FALSE
  12. }
  13. );
  14. Trex.Tool.ReDo = Trex.Class.create({
  15. $const: {
  16. __Identity: 'redo'
  17. },
  18. $extend: Trex.Tool,
  19. oninitialized: function() {
  20. var _canvas = this.canvas;
  21. var _toolHandler = function() {
  22. _canvas.getProcessor().blur();
  23. _canvas.focus();
  24. setTimeout( function(){
  25. _canvas.fireJobs('canvas.panel.redo');
  26. }, 0);
  27. };
  28. /* button & menu weave */
  29. this.weave.bind(this)(
  30. /* button */
  31. new Trex.Button(this.buttonCfg),
  32. /* menu */
  33. _NULL,
  34. /* handler */
  35. _toolHandler
  36. );
  37. this.bindKeyboard({ // ctrl + y - 다시실행
  38. ctrlKey: _TRUE,
  39. keyCode: 89
  40. }, function() {
  41. _canvas.fireJobs('canvas.panel.redo');
  42. _canvas.triggerQueryStatus();
  43. });
  44. }
  45. });