Browse Source

Update how the component's script are appended

no-jquery
Artur Arseniev 8 years ago
parent
commit
57e5ee4eae
  1. 7
      src/canvas/view/CanvasView.js

7
src/canvas/view/CanvasView.js

@ -311,13 +311,14 @@ module.exports = Backbone.View.extend({
view.scriptContainer.html('');
// In editor, I make use of setTimeout as during the append process of elements
// those will not be available immediatly, therefore 'item' variable
view.scriptContainer.append(`<script>
const script = document.createElement('script');
script.innerText = `
setTimeout(function() {
var item = document.getElementById('${id}');
if (!item) return;
(function(){${model.getScriptString()}}.bind(item))()
}, 1);
</script>`);
}, 1);`;
view.scriptContainer.get(0).appendChild(script);
},
/**

Loading…
Cancel
Save