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

Preview state is not being retained on unload & load #161

Closed
sebnitu opened this issue Jul 20, 2012 · 4 comments
Closed

Preview state is not being retained on unload & load #161

sebnitu opened this issue Jul 20, 2012 · 4 comments

Comments

@sebnitu
Copy link
Contributor

sebnitu commented Jul 20, 2012

Sorry, I know I'm making a lot of these :P

Just noticed that when the Editor is loaded it doesn't keep it's previous state (preview mode) and just defaults to edit mode. Is this intended?

@OscarGodson
Copy link
Owner

That'd be a bug. That's something that I just overlooked. I set it to go to edit mode on load, but it should actually check if a state exists, and if a state exists use that otherwise default to edit. I'll get this into the 0.1.2 release also.

OscarGodson added a commit that referenced this issue Jul 21, 2012
… you load again its where you left it. Also added a guard for calling load when its already loaded to save on memory and changed all _eeState checks internally to use is() instead
@OscarGodson
Copy link
Owner

@sebnitu Can you pull and try now? The change was pretty simple, but I did some cleanup. All tests pass still tho.

If you're interested:
I was setting the state at the top to edit on each load. Now I check if edit and preview state is false and if they're both false (first load) then I set it to edit. I also cleaned up how I was setting it to edit/preview. Before I was just display none-ing the preview iframe on load, now I'm actually calling the API methods to preview and edit.

@sebnitu
Copy link
Contributor Author

sebnitu commented Jul 21, 2012

Awesome, works like a charm :D

@OscarGodson
Copy link
Owner

Nice! Keep the bug reports coming :)

hongymagic added a commit to hongymagic/EpicEditor that referenced this issue Jul 29, 2012
* upstream/develop:
  Ticket OscarGodson#96 - Make hash links scroll the iframe, not open a new browser window
  Ticket OscarGodson#6 - Shitty patch for Safari fullscreen. Using faux fullscreen until Safari gets fixed
  Prevent loading the editor when it's already loaded
  Typo in comment
  Ticket OscarGodson#161 - Remember the edit or preview state on unloading so when you load again its where you left it. Also added a guard for calling load when its already loaded to save on memory and changed all _eeState checks internally to use is() instead
  Ticket OscarGodson#88 - Added public is() method to check the state of EE. Added docs and tests and changed eeState to _eeState

Conflicts:
	epiceditor/js/epiceditor.js
	epiceditor/js/epiceditor.min.js
	src/editor.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants