[wp-trac] [WordPress Trac] #22407: Undo and redo in TinyMCE are broken after deleting a view

WordPress Trac noreply at wordpress.org
Sat Nov 10 17:50:04 UTC 2012


#22407: Undo and redo in TinyMCE are broken after deleting a view
--------------------------+--------------------
 Reporter:  azaozz        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  3.5
Component:  Media         |     Version:  trunk
 Severity:  blocker       |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by azaozz):

 22407.patch seems to work well (still includes some debug code for
 testing). It converts all views to their text mode before adding new undo
 level in TinyMCE and converts them back to dom nodes when doing redo.

 In addition it adds another step when deleting a view, so deleting now
 does:
 - Convert the view to it's text.
 - Replace the view wrapper node with a temp span containing that text.
 - Run any 'delete' callbacks.
 - Remove the temp span keeping its content.
 - Cancel the undo level up to this point.
 - Delete the view's text (this is captured in the undo level).

 This introduces quite a bit of overhead on adding new undo levels in
 TinyMCE (which happens pretty often, like on every new paragraph or on
 node changes), but seems to work well with contenteditable=false nodes.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22407#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list