Opened 10 years ago

Last modified 10 years ago

#12167 confirmed Bug

The save plugin needs improvements — at Version 1

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version: 4.2
Keywords: Cc:

Description (last modified by Wiktor Walc)

It looks like the save plugin has been left in a state which is pretty much hard to explain and where this plugin isn't useful at all.

  1. The Save button is only available when editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE, which means that it is not available for example in "Replace Textarea with Inline Editor" where editor mode is ELEMENT_MODE_INLINE.
  1. "Replace Textarea with Inline Editor" is not the only case where the Save buton would be useful. After all thanks to the "save" event each CKEditor instance can benefit from this button to save data using AJAX.
  1. The requirement of having a parent <form> element is invalid. Again, thanks to the save element a developer may want to have such button even inside an instance that is not wrapped inside a form. Actually, if there is a need for the Save button and a listener for "save" event used, it's even more probable that CKEditor is not a part of a form element.

What we should do is:

  1. Keep the Save button always enabled.
  2. If parent <form> element is detected, submit the form.
  3. Always fire the save event when Save button is used: (i) to make it possible to save data through ajax and (ii) to prevent from submitting the form if the developer doesn't want it.

Warning: (1) is tricky as it will enable Save button for any existing instances. On the other side we can simply warn about this in changelog and blog just like we did with ACF.

Change History (1)

comment:1 Changed 10 years ago by Wiktor Walc

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy