mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 19:26:46 +00:00
Fix selection check in wikitext warning
Change-Id: I2f084eb4ee29bd166b05163cd2d6e64e0a4f136d
This commit is contained in:
parent
358268be7a
commit
ab365ccacc
|
@ -770,9 +770,11 @@ ve.init.mw.ViewPageTarget.static.checkForWikitextWarning = function ( surface, w
|
||||||
var text, node, doc = surface.getView().getDocument(),
|
var text, node, doc = surface.getView().getDocument(),
|
||||||
selection = surface.getModel().getSelection(),
|
selection = surface.getModel().getSelection(),
|
||||||
textMatches;
|
textMatches;
|
||||||
if ( !selection ) {
|
|
||||||
|
if ( !( selection instanceof ve.dm.LinearSelection ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
node = doc.getBranchNodeFromOffset( selection.getRange().start );
|
node = doc.getBranchNodeFromOffset( selection.getRange().start );
|
||||||
if ( !( node instanceof ve.ce.ContentBranchNode ) ) {
|
if ( !( node instanceof ve.ce.ContentBranchNode ) ) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue