MOBILE-3523 core: Fix handlers order if one hasn't priority
parent
8d95636690
commit
94b215816e
|
@ -191,7 +191,7 @@ export class CoreContentLinksDelegate {
|
|||
|
||||
// Add them to the list.
|
||||
linkActions.push({
|
||||
priority: handler.priority,
|
||||
priority: handler.priority || 0,
|
||||
actions: actions
|
||||
});
|
||||
}
|
||||
|
|
|
@ -405,7 +405,7 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
|
|||
promises.push(Promise.resolve(getFunction.call(handler, injector, course)).then((data) => {
|
||||
handlersToDisplay.push({
|
||||
data: data,
|
||||
priority: handler.priority,
|
||||
priority: handler.priority || 0,
|
||||
prefetch: handler.prefetch && handler.prefetch.bind(handler),
|
||||
name: handler.name
|
||||
});
|
||||
|
|
|
@ -177,7 +177,7 @@ export class CoreFileUploaderDelegate extends CoreDelegate {
|
|||
}
|
||||
|
||||
const data: CoreFileUploaderHandlerDataToReturn = handler.getData();
|
||||
data.priority = handler.priority;
|
||||
data.priority = handler.priority || 0;
|
||||
data.mimetypes = supportedMimetypes;
|
||||
handlers.push(data);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ export class CoreMainMenuDelegate extends CoreDelegate {
|
|||
handlersData.push({
|
||||
name: name,
|
||||
data: data,
|
||||
priority: handler.priority
|
||||
priority: handler.priority || 0,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -177,6 +177,7 @@ export class CorePushNotificationsDelegate {
|
|||
|
||||
this.logger.log(`Registered addon '${handler.name}'`);
|
||||
this.clickHandlers[handler.name] = handler;
|
||||
handler.priority = handler.priority || 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ export class CoreSettingsDelegate extends CoreDelegate {
|
|||
|
||||
handlersData.push({
|
||||
data: data,
|
||||
priority: handler.priority
|
||||
priority: handler.priority || 0,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ export class CoreSitePluginsCourseOptionHandler extends CoreSitePluginsBaseHandl
|
|||
protected utils: CoreUtilsProvider) {
|
||||
super(name);
|
||||
|
||||
this.priority = handlerSchema.priority;
|
||||
this.priority = handlerSchema.priority || 0;
|
||||
this.isMenuHandler = !!handlerSchema.ismenuhandler;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ export class CoreSitePluginsMainMenuHandler extends CoreSitePluginsBaseHandler i
|
|||
protected initResult: any) {
|
||||
super(name);
|
||||
|
||||
this.priority = handlerSchema.priority;
|
||||
this.priority = handlerSchema.priority || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,7 +32,7 @@ export class CoreSitePluginsMessageOutputHandler extends CoreSitePluginsBaseHand
|
|||
*/
|
||||
getDisplayData(): AddonMessageOutputHandlerData {
|
||||
return {
|
||||
priority: this.handlerSchema.priority,
|
||||
priority: this.handlerSchema.priority || 0,
|
||||
label: this.title,
|
||||
icon: this.handlerSchema.displaydata.icon,
|
||||
page: 'CoreSitePluginsPluginPage',
|
||||
|
|
|
@ -25,7 +25,7 @@ export class CoreSitePluginsSettingsHandler extends CoreSitePluginsBaseHandler i
|
|||
protected initResult: any) {
|
||||
super(name);
|
||||
|
||||
this.priority = handlerSchema.priority;
|
||||
this.priority = handlerSchema.priority || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,7 @@ export class CoreSitePluginsUserProfileHandler extends CoreSitePluginsBaseHandle
|
|||
protected utils: CoreUtilsProvider) {
|
||||
super(name);
|
||||
|
||||
this.priority = handlerSchema.priority;
|
||||
this.priority = handlerSchema.priority || 0;
|
||||
|
||||
// Only support TYPE_COMMUNICATION and TYPE_NEW_PAGE.
|
||||
this.type = handlerSchema.type != CoreUserDelegate.TYPE_COMMUNICATION ?
|
||||
|
|
|
@ -260,7 +260,7 @@ export class CoreUserDelegate extends CoreDelegate {
|
|||
userData.handlers.push({
|
||||
name: name,
|
||||
data: handler.getDisplayData(user, courseId),
|
||||
priority: handler.priority,
|
||||
priority: handler.priority || 0,
|
||||
type: handler.type || CoreUserDelegate.TYPE_NEW_PAGE
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue