enonic / app-contentstudio-old

Enonic XP - Content Studio app
GNU General Public License v3.0
1 stars 1 forks source link

Preserve styles applied in the modal dialog when changing or saving editor contents #561

Closed alansemenov closed 5 years ago

alansemenov commented 5 years ago

NB! To test this feature build branches called "epic-6622" in these repos:

Image modal dialog now applies styles (via class attribute) directly to the figure element, both in the dialog and directly inside the editor (when changes are applied in the dialog). However when content is saved, CKEditor processes editor contents and applies its own classes and inline styles to the figure and img elements. Same thing happens after changing image alignment via buttons in the editor toolbar.

  1. Remove any inline styles that are now applied to figure or img elements. All styling should go via css classes applied to the figure element.
  2. Fix it so that CKEditor doesn't alter classes applied to the figure element when loading editor contents. Keep in mind that styles are now user-definable and we cannot limit classes applied to figure element only by alignment classes - any class name is allowed.
  3. Change behaviour of the alignment buttons in the toolbar so that they apply correct alignment classes to the figure element and are correctly highlighted based on already applied classes (see StyleHelper.STYLE.ALIGNMENT).
  4. Check behaviour of ImageModalDialog.updateOriginalDialogInputValues method - I'm not sure we should set alignment/keepSize there since those classes are already applied to the figure element.