Use new hasContent method on linear data

Change-Id: I430e628a9db30970ecdf6996bc51e7440a474077
This commit is contained in:
Ed Sanders 2015-06-30 09:45:24 +01:00
parent 6aac8eed78
commit 6822635158
2 changed files with 2 additions and 2 deletions

View file

@ -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(

View file

@ -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();
};
/*