Merge pull request #2300 from dpalou/MOBILE-3348
MOBILE-3348 glossary: Filter concepts and fix divider with HTMLmain
commit
b7ffc0042f
|
@ -41,7 +41,7 @@
|
|||
{{ 'addon.mod_glossary.entriestobesynced' | translate }}
|
||||
</ion-item-divider>
|
||||
<a ion-item *ngFor="let entry of offlineEntries" (click)="openNewEntry(entry)" detail-none>
|
||||
<p>{{entry.concept}}</p>
|
||||
<p><core-format-text [text]="entry.concept" contextLevel="module" [contextInstanceId]="glossary.coursemodule" [courseId]="courseId"></core-format-text></p>
|
||||
</a>
|
||||
</ion-list>
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
|||
</ion-item-divider>
|
||||
|
||||
<a ion-item (click)="openEntry(entry.id)" [class.core-split-item-selected]="entry.id == selectedEntry" detail-none>
|
||||
<p>{{entry.concept}}</p>
|
||||
<p><core-format-text [text]="entry.concept" contextLevel="module" [contextInstanceId]="glossary.coursemodule" [courseId]="courseId"></core-format-text></p>
|
||||
</a>
|
||||
</ng-container>
|
||||
</ion-list>
|
||||
|
|
|
@ -320,7 +320,12 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
|
|||
this.fetchFunction = this.glossaryProvider.getEntriesByLetter;
|
||||
this.fetchInvalidate = this.glossaryProvider.invalidateEntriesByLetter;
|
||||
this.fetchArguments = [this.glossary.id, 'ALL'];
|
||||
this.getDivider = (entry: any): string => entry.concept.substr(0, 1).toUpperCase();
|
||||
this.getDivider = (entry: any): string => {
|
||||
// Try to get the first letter without HTML tags.
|
||||
const noTags = this.textUtils.cleanTags(entry.concept);
|
||||
|
||||
return (noTags || entry.concept).substr(0, 1).toUpperCase();
|
||||
};
|
||||
this.showDivider = (entry?: any, previous?: any): boolean => {
|
||||
return !previous || this.getDivider(entry) != this.getDivider(previous);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue