JonasDoebertin / kirby-visual-markdown

Visual Markdown Editor for Kirby CMS 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iOS incompatibility

rasteiner opened this issue · comments

When visiting a panel page having this plugin, with an iPhone (tested on iOS 7 and 9), the panel page keeps reloading (My best guess is that it's Kirby that reloads when detecting a JS error).

I've isolated the problem to this line: https://github.com/JonasDoebertin/kirby-visual-markdown/blob/master/assets/js/visualmarkdownfield.js#L76

The console says something on the line of

'undefined' is not an object (evaluating screenfull.raw.fullscreenchange)

infact, replacing that line with

if(screenfull.raw && screenfull.raw.fullscreenchange) {
        $(document).bind(screenfull.raw.fullscreenchange, self.changeFullscreenModeHandler);
}

kind of solves that problem (the page no longer reloads constantly).
Of course the fullscreen button doesn't work anymore then, but at least the page becomes usable and, given that error message, I'm not sure it would work anyway.