Add editor.goFullscreen() #156

Closed
narfdotpl opened this Issue Jul 19, 2012 · 5 comments

Comments

Projects
None yet
2 participants

I'd like the editor to go into the fullscreen mode immediately after editor.load(). Is that possible? If not, it would be great, if you could add a public goFullscreen() method.

Owner

OscarGodson commented Jul 19, 2012

Working on it from #146. Question: would you like fullscreen() to toggle opening and closing (like it does internally), or would you rather have an explicit exitFullscreen()?

Working on it from #146.

Great!

I'm OK with fullscreen() that toggles, but I think it should be accompanied by a isFullscreen attribute/method.

Owner

OscarGodson commented Jul 19, 2012

There's two other things I'm working on that will take care of the isFullscreen. First is a public method on our eeState object which holds the state of EpicEditor. You'd be able to do .is('fullscreen') (ticket #88, working on it). Also, as with as many events as we can, there's a fullscreen and fullscreenexit event that gets fired as well.

This code is actually finished but I'm writing tests and docs on it. I'll let you know when it's done. Hopefully today or tomorrow.

Note about the fullscreen method tho, you wont be able to programmatically call native fullscreen. If your browser supports native fullscreen and you call fullscreen() it wont fire the native one. Instead it'll use the same faux one used in unsupported browsers. This is a "security" thing in browsers I can't get around. You can only trigger native fullscreen with a UI interaction (key event like a shortcut, mouse event like click, etc).

Also, I'm adding a boolean useNativeFullscreen option as well to override it if you wanted for UI interactions.

@OscarGodson OscarGodson added a commit that referenced this issue Jul 20, 2012

@OscarGodson OscarGodson Ticket #156 #146 - Added enterFullscreen and exitFullscreen as well a…
…s the useNativeFullscreen option. Added docs and tests.
e1d4057
Owner

OscarGodson commented Jul 20, 2012

@narfdotpl Alright, pull develop! I've added the fullscreen API stuff. There's 2 new methods enterFullscreen and exitFullscreen as well as 2 new events fullscreenenter and fullscreenexit and an option to useNativeFullscreen so you can turn off native fullscreen if you want.

Let me know if this is what you expected and is working well!

Thanks, works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment