Merge pull request #1774 from crazyserver/MOBILE-2858-1

MOBILE-2858 grades: Add unkown type grade items
main
Juan Leyva 2019-02-19 09:29:39 +01:00 committed by GitHub
commit bc5f4488f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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];
}