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

Document, rename, and make tests for eeState #88

Closed
OscarGodson opened this issue May 5, 2012 · 1 comment
Closed

Document, rename, and make tests for eeState #88

OscarGodson opened this issue May 5, 2012 · 1 comment

Comments

@OscarGodson
Copy link
Owner

Right now eeState is on the prototype and it keeps track of state in an object like:

{
  edit: true
, fullscreen: false
, loaded: true
, preview: false
, unloaded: false
}

This could actually be extremely useful for a developer. It works fine as AFAIK.

The public facing API could be something simple like:

editor.getState(); // returns everything
editor.getState('fullscreen'); // returns true/false if it's in fullscreen or not
@OscarGodson
Copy link
Owner Author

I'm thinking about changing getState to just is. You could then use it like:

if (editor.is('fullscreen')) {
  // Do stuff.
}

Doing this in 0.1.2 because I'd like to use it internally for ticket #146 and #152 where I'll be working with editor states more.

OscarGodson added a commit that referenced this issue Jul 20, 2012
… docs and tests and changed eeState to _eeState
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

1 participant