From 253abb7f3ce46bc83d3354eb647179802592cb82 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 13 Feb 2020 17:37:36 +0100 Subject: [PATCH] MOBILE-3340 siteplugins: Update preSets when using samePage=true --- .../siteplugins/components/plugin-content/plugin-content.ts | 4 +++- src/core/siteplugins/directives/call-ws-new-content.ts | 2 +- src/core/siteplugins/directives/new-content.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/siteplugins/components/plugin-content/plugin-content.ts b/src/core/siteplugins/components/plugin-content/plugin-content.ts index ed5a89c97..3a0b491c7 100644 --- a/src/core/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/siteplugins/components/plugin-content/plugin-content.ts @@ -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); } diff --git a/src/core/siteplugins/directives/call-ws-new-content.ts b/src/core/siteplugins/directives/call-ws-new-content.ts index fc65d5573..b6c1bdea0 100644 --- a/src/core/siteplugins/directives/call-ws-new-content.ts +++ b/src/core/siteplugins/directives/call-ws-new-content.ts @@ -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; diff --git a/src/core/siteplugins/directives/new-content.ts b/src/core/siteplugins/directives/new-content.ts index d95b34bae..a373a55ee 100644 --- a/src/core/siteplugins/directives/new-content.ts +++ b/src/core/siteplugins/directives/new-content.ts @@ -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;