From 27802484e6e261fea0844dfbfbed5f63956d7197 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Thu, 10 Sep 2015 08:36:48 +0200 Subject: [PATCH] [backport] allow decorators --- app/coffee/app.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index eb8ba1ba..3c52563e 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -503,6 +503,12 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven $translateProvider.fallbackLanguage(preferedLangCode) + # decoratos + decorators = _.where(@.taigaContribPlugins, {"type": "decorator"}) + + _.each decorators, (decorator) -> + $provide.decorator decorator.provider, decorator.decorator + i18nInit = (lang, $translate) -> # i18n - moment.js moment.locale(lang) @@ -592,6 +598,8 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na appMetaService.setAll(title, description) +pluginsWithModule = _.filter(@.taigaContribPlugins, (plugin) -> plugin.module) + modules = [ # Main Global Modules "taigaBase", @@ -636,7 +644,7 @@ modules = [ "pascalprecht.translate", "infinite-scroll", "tgRepeat" -].concat(_.map(@.taigaContribPlugins, (plugin) -> plugin.module)) +].concat(_.map(pluginsWithModule, (plugin) -> plugin.module)) # Main module definition module = angular.module("taiga", modules)