mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Use a blank temp document when selection is empty
shallowCloneFromRange can a broken document if you pass a collapsed range. That should be fixed upstream but for now this fixes a major bug (and is faster). Bug: T150492 Change-Id: I9b539c588d91ef7f22e662c7cae0b3f89b21d33a
This commit is contained in:
parent
20b802cc85
commit
003c5ac410
|
@ -51,7 +51,7 @@ ve.ui.MWWikitextWindowAction.prototype.open = function ( name, data, action ) {
|
|||
originalFragment = fragment;
|
||||
originalDocument = originalFragment.getDocument();
|
||||
coveringRange = originalFragment.getSelection().getCoveringRange();
|
||||
if ( coveringRange ) {
|
||||
if ( coveringRange && !coveringRange.isCollapsed() ) {
|
||||
tempDocument = surface.getModel().getDocument().shallowCloneFromRange( coveringRange );
|
||||
rangeInDocument = tempDocument.originalRange;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue