Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-10917

CKEditor hippoautosave plugin: wrap scheduleSave() in a setTimeout

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.10
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Story Points:
      3
    • Flagged:
      Flagged
    • Processed by team:
      Tiger
    • Sprint:
      Tiger Sprint 173

      Description

      A client sees Javascript errors resulting from conflicts between the non-default CKEditor plugin 'Simplebox' and the default CKEditor plugin 'hippoautosave'.

      This was tracked down to the fact the a call to editor.getData() in the hippoautosave onchange event listener does not always returns the latest changes:

      I found a solution by wrapping the scheduleSave callback within a timeout, because the editor.getData() does not always return the latest changes, and that seems to conflict with the drag and drop behaviour of the widgets

      This kind of solution had been used before, see at https://dev.ckeditor.com/ticket/9794#comment:15

      So the request is to modify the hippoautosave onchange event listener in hippoautosave/plugin.js

      editor.on('change', function () {
          window.setTimeout(function () {
              scheduleSave(editor.getData());
          }, 0);
      }); 
      

      Please evaluate this request.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jhoffman Jeroen Hoffman
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: