Merge pull request #2486 from dpalou/MOBILE-3265
MOBILE-3265 h5p: Delete content indexes when change languagemain
commit
218a3456ad
|
@ -14,8 +14,9 @@
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CoreH5PComponentsModule } from './components/components.module';
|
import { CoreH5PComponentsModule } from './components/components.module';
|
||||||
import { CoreH5PProvider } from './providers/h5p';
|
import { CoreH5P, CoreH5PProvider } from './providers/h5p';
|
||||||
import { CoreH5PPluginFileHandler } from './providers/pluginfile-handler';
|
import { CoreH5PPluginFileHandler } from './providers/pluginfile-handler';
|
||||||
|
import { CoreEventsProvider } from '@providers/events';
|
||||||
import { CorePluginFileDelegate } from '@providers/plugin-file-delegate';
|
import { CorePluginFileDelegate } from '@providers/plugin-file-delegate';
|
||||||
|
|
||||||
// List of providers (without handlers).
|
// List of providers (without handlers).
|
||||||
|
@ -36,8 +37,14 @@ export const CORE_H5P_PROVIDERS: any[] = [
|
||||||
})
|
})
|
||||||
export class CoreH5PModule {
|
export class CoreH5PModule {
|
||||||
constructor(pluginfileDelegate: CorePluginFileDelegate,
|
constructor(pluginfileDelegate: CorePluginFileDelegate,
|
||||||
pluginfileHandler: CoreH5PPluginFileHandler) {
|
pluginfileHandler: CoreH5PPluginFileHandler,
|
||||||
|
eventsProvider: CoreEventsProvider) {
|
||||||
|
|
||||||
pluginfileDelegate.registerHandler(pluginfileHandler);
|
pluginfileDelegate.registerHandler(pluginfileHandler);
|
||||||
|
|
||||||
|
// Delete content indexes if language changes, to update the strings.
|
||||||
|
eventsProvider.on(CoreEventsProvider.LANGUAGE_CHANGED, () => {
|
||||||
|
CoreH5P.instance.h5pPlayer.deleteAllContentIndexes();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue