JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.0.1
[ckeditor.git] / _source / plugins / find / dialogs / find.js
index cc1c2c1..b4196fa 100644 (file)
@@ -425,7 +425,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                var finder = {\r
                        searchRange : null,\r
                        matchRange : null,\r
-                       find : function( pattern, matchCase, matchWord, matchCyclic, highlightMatched )\r
+                       find : function( pattern, matchCase, matchWord, matchCyclic, highlightMatched, cyclicRerun )\r
                        {\r
                                if( !this.matchRange )\r
                                        this.matchRange =\r
@@ -480,10 +480,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                this.matchRange.removeHighlight();\r
                                // Clear current session and restart with the default search\r
                                // range.\r
-                               if ( matchCyclic )\r
+                               // Re-run the finding once for cyclic.(#3517)\r
+                               if ( matchCyclic && !cyclicRerun )\r
                                {\r
                                        this.searchRange = getSearchRange( true );\r
                                        this.matchRange = null;\r
+                                       return arguments.callee.apply( this,\r
+                                               Array.prototype.slice.call( arguments ).concat( [ true ] ) );\r
                                }\r
 \r
                                return false;\r