b6e3fcaccdd39a12ab9d8c1f3712e6aa.json
3.33 KB
{"ast":null,"code":"/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Remove a filter from an image\r\n */\nimport commandFactory from '../factory/command';\nimport { componentNames, commandNames } from '../consts';\nconst {\n FILTER\n} = componentNames;\nconst command = {\n name: commandNames.REMOVE_FILTER,\n\n /**\r\n * Remove a filter from an image\r\n * @param {Graphics} graphics - Graphics instance\r\n * @param {string} type - Filter type\r\n * @returns {Promise}\r\n */\n execute(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n this.undoData.options = filterComp.getOptions(type);\n return filterComp.remove(type);\n },\n\n /**\r\n * @param {Graphics} graphics - Graphics instance\r\n * @param {string} type - Filter type\r\n * @returns {Promise}\r\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n const {\n options\n } = this.undoData;\n return filterComp.add(type, options);\n }\n\n};\ncommandFactory.register(command);\nexport default command;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/src/js/command/removeFilter.js"],"names":["commandFactory","componentNames","commandNames","FILTER","command","name","REMOVE_FILTER","execute","graphics","type","filterComp","getComponent","undoData","options","getOptions","remove","undo","add","register"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,oBAA3B;AACA,SAASC,cAAT,EAAyBC,YAAzB,QAA6C,WAA7C;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAaF,cAAnB;AAEA,MAAMG,OAAO,GAAG;AACdC,EAAAA,IAAI,EAAEH,YAAY,CAACI,aADL;;AAGd;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,OAAO,CAACC,QAAD,EAAWC,IAAX,EAAiB;AACtB,UAAMC,UAAU,GAAGF,QAAQ,CAACG,YAAT,CAAsBR,MAAtB,CAAnB;AAEA,SAAKS,QAAL,CAAcC,OAAd,GAAwBH,UAAU,CAACI,UAAX,CAAsBL,IAAtB,CAAxB;AAEA,WAAOC,UAAU,CAACK,MAAX,CAAkBN,IAAlB,CAAP;AACD,GAfa;;AAgBd;AACF;AACA;AACA;AACA;AACEO,EAAAA,IAAI,CAACR,QAAD,EAAWC,IAAX,EAAiB;AACnB,UAAMC,UAAU,GAAGF,QAAQ,CAACG,YAAT,CAAsBR,MAAtB,CAAnB;AACA,UAAM;AAAEU,MAAAA;AAAF,QAAc,KAAKD,QAAzB;AAEA,WAAOF,UAAU,CAACO,GAAX,CAAeR,IAAf,EAAqBI,OAArB,CAAP;AACD;;AA1Ba,CAAhB;AA6BAb,cAAc,CAACkB,QAAf,CAAwBd,OAAxB;AAEA,eAAeA,OAAf","sourcesContent":["/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Remove a filter from an image\r\n */\r\nimport commandFactory from '../factory/command';\r\nimport { componentNames, commandNames } from '../consts';\r\n\r\nconst { FILTER } = componentNames;\r\n\r\nconst command = {\r\n name: commandNames.REMOVE_FILTER,\r\n\r\n /**\r\n * Remove a filter from an image\r\n * @param {Graphics} graphics - Graphics instance\r\n * @param {string} type - Filter type\r\n * @returns {Promise}\r\n */\r\n execute(graphics, type) {\r\n const filterComp = graphics.getComponent(FILTER);\r\n\r\n this.undoData.options = filterComp.getOptions(type);\r\n\r\n return filterComp.remove(type);\r\n },\r\n /**\r\n * @param {Graphics} graphics - Graphics instance\r\n * @param {string} type - Filter type\r\n * @returns {Promise}\r\n */\r\n undo(graphics, type) {\r\n const filterComp = graphics.getComponent(FILTER);\r\n const { options } = this.undoData;\r\n\r\n return filterComp.add(type, options);\r\n },\r\n};\r\n\r\ncommandFactory.register(command);\r\n\r\nexport default command;\r\n"]},"metadata":{},"sourceType":"module"}