Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Option to live preview without fullscreen mode #391

Open
paulocheque opened this issue Mar 3, 2016 · 6 comments
Open

Suggestion: Option to live preview without fullscreen mode #391

paulocheque opened this issue Mar 3, 2016 · 6 comments

Comments

@paulocheque
Copy link

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.

@OscarGodson
Copy link
Owner

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

@paulocheque
Copy link
Author

It worked perfectly! Thanks!

@paulocheque
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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 paulocheque reopened this Mar 23, 2016
@paulocheque
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants