Changes between Initial Version and Version 1 of Ticket #13377, comment 13


Ignore:
Timestamp:
Jul 3, 2015, 7:05:49 AM (10 years ago)
Author:
Szymon Cofalik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13377, comment 13

    initial v1  
    77In my solution I check ZWS's position in innerHTML of it's parent and write that value as parent's attribute. This way it can't be confused and does not make any impact on actual contents. There is one danger, though. If the contents of ZWS parent changes after we calculate it's position, it may be invalid. My question is if such situation may happen? If so, the method would need some tweaking (see below) but I think this is may be a way to go if we don't want to make workarounds like suppressing events if composition started.
    88
    9 A further tweak may involve saving ZWS in a globally accessible space (like editor instance) so undo manager can read it on it's own and calculate its position after all `beforeUndoImage` events end. This way we achieve two things:
     9A further tweak may involve saving ZWS in a globally accessible space (like editor instance) so undo manager can read it on it's own and calculate its position after all `beforeUndoImage` events end. This way we achieve three things:
    10101. We are guaranteed that editor contents won't change because of other event listeners.
    11112. We get rid of events in selection code.
     123. We don't have to make a mess with another data attribute.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy