Changes between Initial Version and Version 1 of Ticket #13140, comment 6


Ignore:
Timestamp:
Apr 27, 2015, 9:43:08 AM (10 years ago)
Author:
Artur Delura
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13140, comment 6

    initial v1  
    11With fresh mind I found out that everything is fine with ranges. But still true is that bookmark is removed and then tried to be used.
     2
     3This [https://github.com/cksource/ckeditor-dev/blob/d13c4a7c065fd6cb5269cab86342d45084c96fbf/plugins/clipboard/plugin.js#L1397 comment] is very incisive. The problem here is following:
     4
     5'''Step 0:''' Beginning:
     6{{{
     7<div>
     8    <widget></widget>
     9</div>
     10}}}
     11
     12'''Step 1:''' Creating drag boomark (this code made mess with range offsets - see next bookmark creation)
     13{{{
     14<div>
     15    <bookmark drag start>
     16    <widget></widget>
     17    <bookmark drag end>
     18</div>
     19}}}
     20
     21'''Step 2:''' Creating drop boomark
     22{{{
     23<div>
     24    <bookmark drag start>
     25    <widget></widget>
     26    <bookmark drop />
     27    <bookmark drag end>
     28</div>
     29}}}
     30Drop bookmark should be after drag end bookmark but it's in wrong position because adding <bookmark drag start> reorganised offset (++)
     31
     32----
     33
     34If we switch order of step first and the second we will fix this issue, but creates a new one the other way around (drag not right after but right before).
     35{{{
     36<div>
     37    <bookmark drag start>
     38    <bookmark drop />
     39    <widget></widget>
     40    <bookmark drag end>
     41</div>
     42}}}
     43
     44We could introduce some mechanism for updating selection on bookmark creation but it might be painfull and time consuming. What I suggest instead is to right before starting internal drag, check whether there is something to do with it i.e. whether it will change something.
     45
     46We can simply do it by comparing (drag end with drop end) or (drap start with drop start). If they are the same we don't have to do nothing.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy