From 4b669d0ad28409eababd7f532399423d069a38e0 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 8 Jan 2011 16:06:06 +0000 Subject: [PATCH] (bug 26620) JavaScript error in insertTags() when jQuery is present but currentFocused is not set (e.g. on Special:Upload) --- skins/common/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skins/common/edit.js b/skins/common/edit.js index fe5435014c..287fbe3dbd 100644 --- a/skins/common/edit.js +++ b/skins/common/edit.js @@ -78,7 +78,7 @@ window.mwSetupToolbar = function() { // apply tagOpen/tagClose to selection in textarea, // use sampleText instead of selection if there is none window.insertTags = function( tagOpen, tagClose, sampleText ) { - if ( typeof $ != 'undefined' && typeof $.fn.textSelection != 'undefined' && + if ( typeof $ != 'undefined' && typeof $.fn.textSelection != 'undefined' && currentFocused && ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) { $( '#wpTextbox1' ).textSelection( 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose } -- 2.20.1