From: Bartosz DziewoƄski Date: Wed, 31 Jan 2018 05:37:54 +0000 (+0100) Subject: jquery.textSelection: Remove final remnants of WikiEditor iframe support X-Git-Tag: 1.31.0-rc.0~752^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=cc17f011f2beaab0c0c652b86b7052bef8d0b686;p=lhc%2Fweb%2Fwiklou.git jquery.textSelection: Remove final remnants of WikiEditor iframe support After WikiEditor's experimental iframe mode was removed in 952d6b9d8fc1d4ac606b6f8d0a3341ba7ec27e02, the code here was mostly removed in 62b4198859e4ac7cf41775dc8bc943272e3ddfc3, but this little stub remained to support CodeEditor (it piggy-backed on that feature to support textSelection() overrides). That was also cleaned up afterwards in 37228b257896e0a36816a61543ed5809e8ad6596, but everyone forgot about this little remnant. This code was not doing anything, as nothing sets the 'context.$iframe' property anymore, in any extension. Change-Id: I0ffe2405df7d6aaecc51b06ba6c7fea5fd8380b4 --- diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 522e95b871..2b0c52749c 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -25,9 +25,6 @@ $.fn.textSelection = function ( command, options ) { var fn, alternateFn, - context, - hasWikiEditor, - needSave, retval; /** @@ -587,19 +584,7 @@ return; } - context = $( this ).data( 'wikiEditor-context' ); - hasWikiEditor = ( context !== undefined && context.$iframe !== undefined ); - - // IE selection restore voodoo - needSave = false; - if ( hasWikiEditor && context.savedSelection !== null ) { - context.fn.restoreSelection(); - needSave = true; - } retval = ( alternateFn && alternateFn[ command ] || fn[ command ] ).call( this, options ); - if ( hasWikiEditor && needSave ) { - context.fn.saveSelection(); - } return retval; };