storypioneers / kirby-wysiwyg

WYSIWYG panel field for Kirby CMS
Other
125 stars 16 forks source link

formatting: mark text does not work as expected #11

Closed dgdsp closed 9 years ago

dgdsp commented 9 years ago

tested on Safari 8.0.3 (10600.3.18) and Chrome 40.0.2214.115 (64-bit)

kirby-wysiwyg--mark-button--bug--20150223

JonasDoebertin commented 9 years ago

I'll have a look into this.

JonasDoebertin commented 9 years ago

I did some investigations. This is what I found out:

marked text does not highlight the mark button

Seems to be an error with the medium-editor script. If you select one character more at the beginning and the end of the marked content, the button is properly highlighted. There should be an issue opened on the editors repo.

unmarking marked text does not work

Same as above.

marking of text is not saved

You're right. Inserting styles with our three custom buttons (mark, ins. del) doesn't trigger the input event on the contenteditable <div> like the standard buttons do. Should be fixable quite easily. Will work on that.

only when marking the whole line, the mark button is highlighted and the text can be unmarked, the mark button stays active though

Related to 1. and 2.

JonasDoebertin commented 9 years ago

It seems we can listen to changes made with both the standard and the custom buttons by listening to DOMSubtreeModified on the editable element instead of the classic input event.

JonasDoebertin commented 9 years ago

The other issues are related to the MediumButton script. Unfortunately, that script isn't hosted on GitHub and I wasn't able to contact the author, yet.

JonasDoebertin commented 9 years ago

Change of event implemented with 265826bfa0f8c5099570c43462046f75911c9ff1.