Skip to content

Commit

Permalink
CKEditor: only run cut-and-paste event when there is no text content
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Dietrich authored and Craig Dietrich committed May 1, 2016
1 parent 91af2b2 commit b3e3e56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/application/views/widgets/ckeditor/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
* @author Craig Dietrich
* @version 1.0
*/
$(document).on('paste', 'textarea', function (e) { // Text is cut-and-paste into 'source' mode
$(document).on('paste', 'textarea', function (e, c) { // Text is cut-and-paste into 'source' mode
if ('undefined'!=typeof(codemirror_cke_1)) {
var orig = codemirror_cke_1.getValue();
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
var myFunc = function(obj1, obj2) {
codemirror_cke_1.off('change', myFunc);
var val = codemirror_cke_1.getValue();
Expand Down

0 comments on commit b3e3e56

Please sign in to comment.