Use the new system for decorator plugins

stable
David Barragán Merino 2015-12-21 12:34:08 +01:00
parent e4288e7c60
commit d1af25a596
2 changed files with 10 additions and 2 deletions

View File

@ -15,6 +15,13 @@ window.taigaConfig = {
"maxUploadFileSize": null,
"contribPlugins": []
}
window._decorators= []
window.addDecorator = (provider, decorator) ->
window._decorators.push({provider: provider, decorator: decorator})
window.getDecorators = ->
return window._decorators
loadStylesheet = (path) ->
$('head').append('<link rel="stylesheet" href="' + path + '" type="stylesheet" />')

View File

@ -516,12 +516,13 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
$translateProvider.fallbackLanguage(preferedLangCode)
# decoratos
decorators = _.where(@.taigaContribPlugins, {"type": "decorator"})
# decoratos plugins
decorators = window.getDecorators()
_.each decorators, (decorator) ->
$provide.decorator decorator.provider, decorator.decorator
i18nInit = (lang, $translate) ->
# i18n - moment.js
moment.locale(lang)