MOBILE-3213 text: Fix check html is blank

main
Pau Ferrer Ocaña 2019-12-12 17:43:40 +01:00
parent 34b6ab1fe1
commit 7cfb0a8c9d
2 changed files with 3 additions and 2 deletions

View File

@ -328,7 +328,8 @@ export class AddonModWorkshopEditSubmissionPage implements OnInit, OnDestroy {
const noText = this.textUtils.htmlIsBlank(inputData.content); const noText = this.textUtils.htmlIsBlank(inputData.content);
const noFiles = !inputData.attachmentfiles.length; const noFiles = !inputData.attachmentfiles.length;
if (this.textRequired && noText || this.fileRequired && noFiles || noText && noFiles) {
if ((this.textRequired && noText) || (this.fileRequired && noFiles) || (noText && noFiles)) {
this.domUtils.showAlertTranslated('core.notice', 'addon.mod_workshop.submissionrequiredcontent'); this.domUtils.showAlertTranslated('core.notice', 'addon.mod_workshop.submissionrequiredcontent');
return Promise.reject(null); return Promise.reject(null);

View File

@ -516,7 +516,7 @@ export class CoreTextUtilsProvider {
this.template.innerHTML = content; this.template.innerHTML = content;
return this.template.textContent === '' && this.template.content.querySelector('img, object, hr') === null; return this.template.content.textContent == '' && this.template.content.querySelector('img, object, hr') === null;
} }
/** /**