mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Use new hasContent method on linear data
Change-Id: I430e628a9db30970ecdf6996bc51e7440a474077
This commit is contained in:
parent
6aac8eed78
commit
6822635158
|
@ -484,7 +484,7 @@ ve.dm.MWImageModel.prototype.insertImageNode = function ( fragment ) {
|
|||
fragment.insertContent( contentToInsert );
|
||||
// Check if there is caption document and insert it
|
||||
captionDoc = this.getCaptionDocument();
|
||||
if ( captionDoc.data.countNonInternalElements() > 2 ) {
|
||||
if ( captionDoc.data.hasContent() ) {
|
||||
// Add contents of new caption
|
||||
surfaceModel.change(
|
||||
ve.dm.Transaction.newFromDocumentInsertion(
|
||||
|
|
|
@ -137,7 +137,7 @@ ve.ui.MWReferenceDialog.static.getImportRules = function () {
|
|||
*/
|
||||
ve.ui.MWReferenceDialog.prototype.documentHasContent = function () {
|
||||
// TODO: Check for other types of empty, e.g. only whitespace?
|
||||
return this.referenceModel.getDocument().data.countNonInternalElements() > 2;
|
||||
return this.referenceModel.getDocument().data.hasContent();
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue