JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.1
[ckeditor.git] / _source / plugins / find / dialogs / find.js
index 5fb9c6e..6711fe5 100644 (file)
@@ -853,6 +853,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                // Establish initial searching start position.\r
                                finder.searchRange = getSearchRange();\r
 \r
+                               // Fill in the find field with selected text.\r
+                               var selectedText = this.getParentEditor().getSelection().getSelectedText(),\r
+                                       patternFieldId = ( startupPage == 'find' ? 'txtFindFind' : 'txtFindReplace' );\r
+\r
+                               var field = this.getContentElement( startupPage, patternFieldId );\r
+                               field.setValue( selectedText );\r
+                               field.select();\r
+\r
                                this.selectPage( startupPage );\r
 \r
                                this[ ( startupPage == 'find' && this._.editor.readOnly? 'hide' : 'show' ) + 'Page' ]( 'replace');\r