0

Im building drag and drop editor of emails with live preview in Ractivejs (i can't change the framework) and im facing issue to which I don't know the answer.

I have an list of components that im dragging into an "canvas" (not html canvas, just some div element) and I need to display DOM of email there with styles and components that has been dropped to "canvas". Since I don't want to interfere with styles of CMS in which Im building this editor, only solution I have is to drag components into an iframe.

Problem is that i need to communicate between those two DOMs (parent DOM and iframe DOM) and to communicate this way between components (and views) in ractive. I mean, in iframe there is no ractive (no connection) Im using in parent DOM. I haven't found any solution to this. In ractive, Im using this drag and drop "event defining" module https://www.npmjs.com/package/ractive-drag-events

I hope it is clear what is my question about and in case it is not, I will definitelly answer any additional questions just to solve this ;)

1 Answers1

0

If I understand your question correctly, you are trying to communicate from the iframe to the parent dom. This question has already been answered. Have a look here iframe accessing parent DOM?

Community
  • 1
  • 1
Guenther
  • 2,035
  • 2
  • 15
  • 20
  • Yes I mean this in case ov native JS, but I also need to communicate between components in Ractivejs. Communicating in javascript without using any framework is no problem there. I don't think i can communicate with Ractive bi-directional this way. But maybe I'm wrong. – vvportes Sep 02 '16 at 19:38