Merge "jquery.textSelection: Remove final remnants of WikiEditor iframe support"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 31 Jan 2018 15:53:28 +0000 (15:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 31 Jan 2018 15:53:28 +0000 (15:53 +0000)
1  2 
resources/src/jquery/jquery.textSelection.js

@@@ -25,9 -25,6 +25,6 @@@
        $.fn.textSelection = function ( command, options ) {
                var fn,
                        alternateFn,
-                       context,
-                       hasWikiEditor,
-                       needSave,
                        retval;
  
                /**
                                        // Return [start, end] instead of just start
                                        startAndEnd: false
                                }, options );
 -                              // FIXME: We may not need character position-based functions if we insert markers in the right places
                                break;
                        case 'setSelection':
                                options = $.extend( {
                                if ( options.end === undefined ) {
                                        options.end = options.start;
                                }
 -                              // FIXME: We may not need character position-based functions if we insert markers in the right places
                                break;
                        case 'scrollToCaretPosition':
                                options = $.extend( {
                                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;
        };