Use the new system for decorator plugins
parent
e4288e7c60
commit
d1af25a596
|
@ -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" />')
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue