2020-09-04 20:34:30 +00:00
|
|
|
{"version":3,"file":"ext-panning.js","sources":["../../../src/editor/extensions/ext-panning.js"],"sourcesContent":["/**\n * @file ext-panning.js\n *\n * @license MIT\n *\n * @copyright 2013 Luis Aguirre\n *\n */\n/*\n This is a very basic SVG-Edit extension to let tablet/mobile devices pan without problem\n*/\n\nexport default {\n name: 'panning',\n async init ({importLocale}) {\n const strings = await importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const buttons = [{\n id: 'ext-panning',\n icon: 'panning.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('ext-panning');\n }\n }\n }];\n return {\n name: strings.name,\n svgicons: 'ext-panning.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n mouseDown () {\n if (svgCanvas.getMode() === 'ext-panning') {\n svgEditor.setPanning(true);\n return {started: true};\n }\n return undefined;\n },\n mouseUp () {\n if (svgCanvas.getMode() === 'ext-panning') {\n svgEditor.setPanning(false);\n return {\n keep: false,\n element: null\n };\n }\n return undefined;\n }\n };\n }\n};\n"],"names":["name","init","importLocale","strings","svgCanvas","svgEditor","_this","canvas","buttons","id","icon","type","events","click","setMode","svgicons","map","button","i","Object","assign","mouseDown","getMode","setPanning","started","mouseUp","keep","element"],"mappings":";;;;;;;;;AAYA,MAAe,CACbA,KAAM,UACAC,udAAOC,IAAAA,sBACWA,kBAAhBC,SAEAC,GADAC,EAAYC,GACUC,OACtBC,EAAU,CAAC,CACfC,GAAI,cACJC,KAAM,cACNC,KAAM,OACNC,OAAQ,CACNC,uBACET,EAAUU,QAAQ,qCAIjB,CACLd,KAAMG,EAAQH,KACde,SAAU,kBACVP,QAASL,EAAQK,QAAQQ,KAAI,SAACC,EAAQC,UAC7BC,OAAOC,OAAOZ,EAAQU,GAAID,MAEnCI,kCAC8B,gBAAxBjB,EAAUkB,iBACZjB,EAAUkB,YAAW,GACd,CAACC,SAAS,IAIrBC,8BAC8B,gBAAxBrB,EAAUkB,iBACZjB,EAAUkB,YAAW,GACd,CACLG,MAAM,EACNC,QAAS"}
|