From: Roan Kattouw Date: Sat, 8 Jan 2011 16:06:06 +0000 (+0000) Subject: (bug 26620) JavaScript error in insertTags() when jQuery is present but currentFocuse... X-Git-Tag: 1.31.0-rc.0~32693 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=4b669d0ad28409eababd7f532399423d069a38e0;p=lhc%2Fweb%2Fwiklou.git (bug 26620) JavaScript error in insertTags() when jQuery is present but currentFocused is not set (e.g. on Special:Upload) --- 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 }