Skip to content

Commit b3e3e56

Browse files
Craig DietrichCraig Dietrich
authored andcommitted
CKEditor: only run cut-and-paste event when there is no text content
1 parent 91af2b2 commit b3e3e56

File tree

1 file changed

+3
-1
lines changed
  • system/application/views/widgets/ckeditor

1 file changed

+3
-1
lines changed

system/application/views/widgets/ckeditor/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
* @author Craig Dietrich
99
* @version 1.0
1010
*/
11-
$(document).on('paste', 'textarea', function (e) { // Text is cut-and-paste into 'source' mode
11+
$(document).on('paste', 'textarea', function (e, c) { // Text is cut-and-paste into 'source' mode
1212
if ('undefined'!=typeof(codemirror_cke_1)) {
13+
var orig = codemirror_cke_1.getValue();
14+
if (orig != '' && orig.length > 0) return; // If there is existing text don't run this since it will add line breaks to text that has already been processed
1315
var myFunc = function(obj1, obj2) {
1416
codemirror_cke_1.off('change', myFunc);
1517
var val = codemirror_cke_1.getValue();

0 commit comments

Comments
 (0)