EpicEditor icon indicating copy to clipboard operation
EpicEditor copied to clipboard

Suggestion: Option to live preview without fullscreen mode

Open paulocheque opened this issue 8 years ago • 6 comments

Is that possible? I believe the fullscreen mode should be independent of the live_preview mode.

We could have fullscreen only for edition, and non-fullscreen with live_preview.

paulocheque avatar Mar 03 '16 19:03 paulocheque

This should be possible with minimal use of the API. You would just make another empty div and on editor update you update the div contents

https://gist.github.com/OscarGodson/d58ef4994ee703ce6622

OscarGodson avatar Mar 03 '16 19:03 OscarGodson

It worked perfectly! Thanks!

paulocheque avatar Mar 11 '16 20:03 paulocheque

Actually this solution is a hack, right? This solution worked for me, but the preview' style does not work because we are not using the preview iframe anymore. So I have to create a new style for that. So all the documentation about themes does not work for this scenario.

paulocheque avatar Mar 15 '16 06:03 paulocheque

Well, actually this solution works but it has performance problems when the text is extensive. I will check what is the solution in the fullscreen mode.

paulocheque avatar Mar 23 '16 06:03 paulocheque

One of the reasons of the bad performance is the following code:

// Even if autoSave is false, we want to make sure to keep the textarea synced
// with the editor's content. One bad thing about this tho is that we're
// creating two timers now in some configurations. We keep the textarea synced
// by saving and opening the textarea content from the draft file storage.
self._textareaSaveTimer = window.setInterval(function () {
  if (!self._canSave) {
    return;
  }
  self.save(true);
}, 100);

paulocheque avatar Mar 23 '16 19:03 paulocheque

Well, actually I was able to solve the performance problems with a debounce strategy during the preview update!

paulocheque avatar Mar 24 '16 07:03 paulocheque