4051188be125f3d7e99f81565ab82003.json
3.01 KB
{"ast":null,"code":"/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Add an image object\r\n */\nimport commandFactory from '../factory/command';\nimport { Promise } from '../util';\nimport { commandNames } from '../consts';\nconst command = {\n name: commandNames.ADD_IMAGE_OBJECT,\n\n /**\r\n * Add an image object\r\n * @param {Graphics} graphics - Graphics instance\r\n * @param {string} imgUrl - Image url to make object\r\n * @returns {Promise}\r\n */\n execute(graphics, imgUrl) {\n return graphics.addImageObject(imgUrl).then(objectProps => {\n this.undoData.object = graphics.getObject(objectProps.id);\n return objectProps;\n });\n },\n\n /**\r\n * @param {Graphics} graphics - Graphics instance\r\n * @returns {Promise}\r\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\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/addImageObject.js"],"names":["commandFactory","Promise","commandNames","command","name","ADD_IMAGE_OBJECT","execute","graphics","imgUrl","addImageObject","then","objectProps","undoData","object","getObject","id","undo","remove","resolve","register"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,oBAA3B;AACA,SAASC,OAAT,QAAwB,SAAxB;AACA,SAASC,YAAT,QAA6B,WAA7B;AAEA,MAAMC,OAAO,GAAG;AACdC,EAAAA,IAAI,EAAEF,YAAY,CAACG,gBADL;;AAGd;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,OAAO,CAACC,QAAD,EAAWC,MAAX,EAAmB;AACxB,WAAOD,QAAQ,CAACE,cAAT,CAAwBD,MAAxB,EAAgCE,IAAhC,CAAsCC,WAAD,IAAiB;AAC3D,WAAKC,QAAL,CAAcC,MAAd,GAAuBN,QAAQ,CAACO,SAAT,CAAmBH,WAAW,CAACI,EAA/B,CAAvB;AAEA,aAAOJ,WAAP;AACD,KAJM,CAAP;AAKD,GAfa;;AAgBd;AACF;AACA;AACA;AACEK,EAAAA,IAAI,CAACT,QAAD,EAAW;AACbA,IAAAA,QAAQ,CAACU,MAAT,CAAgB,KAAKL,QAAL,CAAcC,MAA9B;AAEA,WAAOZ,OAAO,CAACiB,OAAR,EAAP;AACD;;AAxBa,CAAhB;AA2BAlB,cAAc,CAACmB,QAAf,CAAwBhB,OAAxB;AAEA,eAAeA,OAAf","sourcesContent":["/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Add an image object\r\n */\r\nimport commandFactory from '../factory/command';\r\nimport { Promise } from '../util';\r\nimport { commandNames } from '../consts';\r\n\r\nconst command = {\r\n name: commandNames.ADD_IMAGE_OBJECT,\r\n\r\n /**\r\n * Add an image object\r\n * @param {Graphics} graphics - Graphics instance\r\n * @param {string} imgUrl - Image url to make object\r\n * @returns {Promise}\r\n */\r\n execute(graphics, imgUrl) {\r\n return graphics.addImageObject(imgUrl).then((objectProps) => {\r\n this.undoData.object = graphics.getObject(objectProps.id);\r\n\r\n return objectProps;\r\n });\r\n },\r\n /**\r\n * @param {Graphics} graphics - Graphics instance\r\n * @returns {Promise}\r\n */\r\n undo(graphics) {\r\n graphics.remove(this.undoData.object);\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"}