e73cf4af652c026111a0a65d5bec3aa9.json
2.96 KB
{"ast":null,"code":"/**\r\n * @author NHN. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview change selection\r\n */\nimport commandFactory from '../factory/command';\nimport { Promise } from '../util';\nimport { commandNames } from '../consts';\nimport { getCachedUndoDataForDimension } from '../helper/selectionModifyHelper';\nconst command = {\n name: commandNames.CHANGE_SELECTION,\n\n execute(graphics, props) {\n if (this.isRedo) {\n props.forEach(prop => {\n graphics.setObjectProperties(prop.id, prop);\n });\n } else {\n this.undoData = getCachedUndoDataForDimension();\n }\n\n return Promise.resolve();\n },\n\n undo(graphics) {\n this.undoData.forEach(datum => {\n graphics.setObjectProperties(datum.id, datum);\n });\n return Promise.resolve();\n }\n\n};\ncommandFactory.register(command);\nexport default command;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/src/js/command/changeSelection.js"],"names":["commandFactory","Promise","commandNames","getCachedUndoDataForDimension","command","name","CHANGE_SELECTION","execute","graphics","props","isRedo","forEach","prop","setObjectProperties","id","undoData","resolve","undo","datum","register"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,oBAA3B;AACA,SAASC,OAAT,QAAwB,SAAxB;AACA,SAASC,YAAT,QAA6B,WAA7B;AACA,SAASC,6BAAT,QAA8C,iCAA9C;AAEA,MAAMC,OAAO,GAAG;AACdC,EAAAA,IAAI,EAAEH,YAAY,CAACI,gBADL;;AAGdC,EAAAA,OAAO,CAACC,QAAD,EAAWC,KAAX,EAAkB;AACvB,QAAI,KAAKC,MAAT,EAAiB;AACfD,MAAAA,KAAK,CAACE,OAAN,CAAeC,IAAD,IAAU;AACtBJ,QAAAA,QAAQ,CAACK,mBAAT,CAA6BD,IAAI,CAACE,EAAlC,EAAsCF,IAAtC;AACD,OAFD;AAGD,KAJD,MAIO;AACL,WAAKG,QAAL,GAAgBZ,6BAA6B,EAA7C;AACD;;AAED,WAAOF,OAAO,CAACe,OAAR,EAAP;AACD,GAba;;AAcdC,EAAAA,IAAI,CAACT,QAAD,EAAW;AACb,SAAKO,QAAL,CAAcJ,OAAd,CAAuBO,KAAD,IAAW;AAC/BV,MAAAA,QAAQ,CAACK,mBAAT,CAA6BK,KAAK,CAACJ,EAAnC,EAAuCI,KAAvC;AACD,KAFD;AAIA,WAAOjB,OAAO,CAACe,OAAR,EAAP;AACD;;AApBa,CAAhB;AAuBAhB,cAAc,CAACmB,QAAf,CAAwBf,OAAxB;AAEA,eAAeA,OAAf","sourcesContent":["/**\r\n * @author NHN. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview change selection\r\n */\r\nimport commandFactory from '../factory/command';\r\nimport { Promise } from '../util';\r\nimport { commandNames } from '../consts';\r\nimport { getCachedUndoDataForDimension } from '../helper/selectionModifyHelper';\r\n\r\nconst command = {\r\n name: commandNames.CHANGE_SELECTION,\r\n\r\n execute(graphics, props) {\r\n if (this.isRedo) {\r\n props.forEach((prop) => {\r\n graphics.setObjectProperties(prop.id, prop);\r\n });\r\n } else {\r\n this.undoData = getCachedUndoDataForDimension();\r\n }\r\n\r\n return Promise.resolve();\r\n },\r\n undo(graphics) {\r\n this.undoData.forEach((datum) => {\r\n graphics.setObjectProperties(datum.id, datum);\r\n });\r\n\r\n return Promise.resolve();\r\n },\r\n};\r\n\r\ncommandFactory.register(command);\r\n\r\nexport default command;\r\n"]},"metadata":{},"sourceType":"module"}