Commit 688eafa7 authored by Jakob Larsen's avatar Jakob Larsen Committed by Jeff Hipp
Browse files

Issue #2932007 by googletorp, cedewey: Maxlength disables WYSIWYG fields when...

Issue #2932007 by googletorp, cedewey: Maxlength disables WYSIWYG fields when max is reached using an unordered list
parent 1ec2a54f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -349,6 +349,12 @@

  // Sets the data into a ckeditor.
  ml.ckeditorSetData = function(e, data) {
    // WYSIWYG can convert '\r\n' to '\n' and insert '\n' after some tags, this
    // can result in circular changes as what is attempted to be inserted and
    // what is actually inserted is different. We save the last inserted value
    // on the editor to stop this issue.
    if (e.editor.mlLastBeforeInsert !== e.editor.getData()) {
      e.editor.mlLastBeforeInsert = e.editor.getData();
      // Calling setData() will place the cursor at the beginning, so we need to
      // implement a callback to place it at the end, which is where the text is
      // being truncated.
@@ -359,5 +365,6 @@
        e.editor.getSelection().selectRanges([range]);
      }});
    }
  }

})(jQuery, Drupal);