From 21b7f08e18d4fab3692df9529f2ee5444213a751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 8 Nov 2018 18:42:41 +0100 Subject: [PATCH] Move activity template overriding to the constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/controller/ActivityController.js | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/js/controller/ActivityController.js b/js/controller/ActivityController.js index 0870170b4..30a786432 100644 --- a/js/controller/ActivityController.js +++ b/js/controller/ActivityController.js @@ -64,6 +64,23 @@ class ActivityController { this.activityservice.subscribe(this.$scope, function() { self.$scope.$apply(); }); + + if (typeof OCA.Activity.Templates !== 'undefined') { + OCA.Activity.Templates.userLocal = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var helper; + // Compiled handlesbars template + // ' {{ name }}'; + return " " + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + + ""; + },"useData":true}); + } else { + OCA.Activity.RichObjectStringParser._userLocalTemplate = ' {{ name }}'; + } } applyAtWho($target) { @@ -263,23 +280,6 @@ class ActivityController { } parseMessage(subject, parameters) { - if (typeof OCA.Activity.Templates !== 'undefined') { - OCA.Activity.Templates.userLocal = {"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper; - // Compiled handlesbars template - // ' {{ name }}'; - return " " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) - + ""; - },"useData":true}; - } else { - OCA.Activity.RichObjectStringParser._userLocalTemplate = ' {{ name }}'; - } - return OCA.Activity.RichObjectStringParser.parseMessage(subject, parameters); }