MOBILE-2858 grades: Add unkown type grade items

main
Pau Ferrer Ocaña 2019-02-14 16:15:53 +01:00
parent 575285077f
commit 6c2eeee6bb
1 changed files with 3 additions and 1 deletions

View File

@ -440,13 +440,15 @@ export class CoreGradesHelperProvider {
this.domUtils.convertToElement(text).querySelector('img').getAttribute('src'));
}
} else {
if (row['rowspan']) {
if (row['rowspan'] && row['rowspan'] > 1) {
row['itemtype'] = 'category';
row['icon'] = 'fa-folder';
} else if (text.indexOf('src=') > -1) {
row['itemtype'] = 'unknown';
const src = text.match(/src="([^"]*)"/);
row['image'] = src[1];
} else if (text.indexOf('<i ') > -1) {
row['itemtype'] = 'unknown';
const src = text.match(/class="fa-([^ ]*)"/);
row['icon'] = src[1];
}