private-face / jquery.fullscreen

jQuery plugin for opening page elements in fullscreen mode.
MIT License
148 stars 83 forks source link

IE // JS-Error on call $.fullscreen.exit() when fullscreen wasn't open #23

Closed wachri closed 10 years ago

wachri commented 10 years ago

When you call $.fullscreen.exit(); and the fullscreen wasn't open, you get the error

SCRIPT5007: Die Eigenschaft "styles" eines undefinierten oder Nullverweises kann nicht abgerufen werden. jquery.fullscreen-0.4.1.js, Zeile 128 Zeichen 3

I fixed that in Line 238 with:

    exit: function() {
        //added block
        if (!this.__isFullScreen) {
            return;
        }
        //added block ENDE

        this.__isFullScreen = false;
        this._fullScreenChange();
    },
private-face commented 10 years ago

@wachri Thank you for the report and fix! You can submit a pull-request with it if you wish. If not, please comment here, I will make the changes myself.