X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ffind%2Fdialogs%2Ffind.js;h=6711fe58740d6907dc6c99dd1abea9df4ee4ea5c;hp=5fb9c6ea9c5fe11df132099746e0862c3b504809;hb=f0610347140239143439a511ee2bd48cb784f470;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index 5fb9c6e..6711fe5 100644 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -853,6 +853,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Establish initial searching start position. finder.searchRange = getSearchRange(); + // Fill in the find field with selected text. + var selectedText = this.getParentEditor().getSelection().getSelectedText(), + patternFieldId = ( startupPage == 'find' ? 'txtFindFind' : 'txtFindReplace' ); + + var field = this.getContentElement( startupPage, patternFieldId ); + field.setValue( selectedText ); + field.select(); + this.selectPage( startupPage ); this[ ( startupPage == 'find' && this._.editor.readOnly? 'hide' : 'show' ) + 'Page' ]( 'replace');