Use the new system for decorator plugins
parent
e4288e7c60
commit
d1af25a596
|
@ -15,6 +15,13 @@ window.taigaConfig = {
|
||||||
"maxUploadFileSize": null,
|
"maxUploadFileSize": null,
|
||||||
"contribPlugins": []
|
"contribPlugins": []
|
||||||
}
|
}
|
||||||
|
window._decorators= []
|
||||||
|
|
||||||
|
window.addDecorator = (provider, decorator) ->
|
||||||
|
window._decorators.push({provider: provider, decorator: decorator})
|
||||||
|
|
||||||
|
window.getDecorators = ->
|
||||||
|
return window._decorators
|
||||||
|
|
||||||
loadStylesheet = (path) ->
|
loadStylesheet = (path) ->
|
||||||
$('head').append('<link rel="stylesheet" href="' + path + '" type="stylesheet" />')
|
$('head').append('<link rel="stylesheet" href="' + path + '" type="stylesheet" />')
|
||||||
|
|
|
@ -516,12 +516,13 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
||||||
|
|
||||||
$translateProvider.fallbackLanguage(preferedLangCode)
|
$translateProvider.fallbackLanguage(preferedLangCode)
|
||||||
|
|
||||||
# decoratos
|
# decoratos plugins
|
||||||
decorators = _.where(@.taigaContribPlugins, {"type": "decorator"})
|
decorators = window.getDecorators()
|
||||||
|
|
||||||
_.each decorators, (decorator) ->
|
_.each decorators, (decorator) ->
|
||||||
$provide.decorator decorator.provider, decorator.decorator
|
$provide.decorator decorator.provider, decorator.decorator
|
||||||
|
|
||||||
|
|
||||||
i18nInit = (lang, $translate) ->
|
i18nInit = (lang, $translate) ->
|
||||||
# i18n - moment.js
|
# i18n - moment.js
|
||||||
moment.locale(lang)
|
moment.locale(lang)
|
||||||
|
|
Loading…
Reference in New Issue