Opened 11 years ago
Last modified 11 years ago
#12167 confirmed Bug
The save plugin needs improvements — at Initial Version
Reported by: | Wiktor Walc | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.2 |
Keywords: | Cc: |
Description
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.
- 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 isELEMENT_MODE_INLINE
.
- "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.
- 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:
- keep the Save button always enabled
- if parent <form> element is detected, submit the form
- 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.