refactor to class step 1

This commit is contained in:
JFH
2020-12-29 14:18:22 +01:00
parent 22212f3096
commit eb77d57fa1
24 changed files with 1678 additions and 1747 deletions

View File

@@ -8,7 +8,7 @@ export default {
name: 'xdomain-messaging',
init () {
const svgEditor = this;
const svgCanvas = svgEditor.canvas;
const {svgCanvas} = svgEditor;
try {
window.addEventListener('message', function (e) {
// We accept and post strings for the sake of IE9 support
@@ -22,7 +22,7 @@ export default {
// The default is not to allow any origins, including even the same domain or
// if run on a `file:///` URL. See `svgedit-config-es.js` for an example of how
// to configure
const {allowedOrigins} = svgEditor.curConfig;
const {allowedOrigins} = svgEditor.configObj.curConfig;
if (!allowedOrigins.includes('*') && !allowedOrigins.includes(e.origin)) {
console.log(`Origin ${e.origin} not whitelisted for posting to ${window.origin}`); // eslint-disable-line no-console
return;