MOBILE-3340 siteplugins: Update preSets when using samePage=true

main
Dani Palou 2020-02-13 17:37:36 +01:00
parent 6d06a7e41c
commit 253abb7f3c
3 changed files with 5 additions and 3 deletions

View File

@ -170,12 +170,14 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck {
* @param component New component. If not provided, current component
* @param method New method. If not provided, current method
* @param jsData JS variables to pass to the new view so they can be used in the template or JS.
* @param preSets New preSets to use. If not provided, use current preSets.
*/
updateContent(args: any, component?: string, method?: string, jsData?: any): void {
updateContent(args: any, component?: string, method?: string, jsData?: any, preSets?: any): void {
this.component = component || this.component;
this.method = method || this.method;
this.args = args;
this.dataLoaded = false;
this.preSets = preSets || this.preSets;
if (jsData) {
Object.assign(this.data, jsData);
}

View File

@ -87,7 +87,7 @@ export class CoreSitePluginsCallWSNewContentDirective extends CoreSitePluginsCal
if (this.utils.isTrueOrOne(this.samePage)) {
// Update the parent content (if it exists).
if (this.parentContent) {
this.parentContent.updateContent(args, this.component, this.method, this.jsData);
this.parentContent.updateContent(args, this.component, this.method, this.jsData, this.newContentPreSets);
}
} else {
let jsData = this.jsData;

View File

@ -84,7 +84,7 @@ export class CoreSitePluginsNewContentDirective implements OnInit {
if (this.utils.isTrueOrOne(this.samePage)) {
// Update the parent content (if it exists).
if (this.parentContent) {
this.parentContent.updateContent(args, this.component, this.method, this.jsData);
this.parentContent.updateContent(args, this.component, this.method, this.jsData, this.preSets);
}
} else {
let jsData = this.jsData;