jquery.textSelection: Remove final remnants of WikiEditor iframe support
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 31 Jan 2018 05:37:54 +0000 (06:37 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 31 Jan 2018 05:37:54 +0000 (06:37 +0100)
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

resources/src/jquery/jquery.textSelection.js

index 522e95b..2b0c527 100644 (file)
@@ -25,9 +25,6 @@
        $.fn.textSelection = function ( command, options ) {
                var fn,
                        alternateFn,
-                       context,
-                       hasWikiEditor,
-                       needSave,
                        retval;
 
                /**
                                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;
        };