(bug 27355) Guard against context being null, this happens when wikiEditor disables...
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 20 Feb 2011 19:27:03 +0000 (19:27 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 20 Feb 2011 19:27:03 +0000 (19:27 +0000)
resources/jquery/jquery.textSelection.js

index 6faeab8..d84a5c2 100644 (file)
@@ -386,7 +386,7 @@ scrollToCaretPosition: function( options ) {
                        break;
        }
        var context = $(this).data( 'wikiEditor-context' );
-       var hasIframe = context !== undefined && context.$iframe !== undefined;
+       var hasIframe = typeof context !== 'undefined' && context && typeof context.$iframe !== 'undefined';
        
        // IE selection restore voodoo
        var needSave = false;