widgets: fix nested scoped css prioriry order

This commit is contained in:
jean-emmanuel 2017-02-22 10:03:33 +01:00
parent 73666425b8
commit 41426c69ba

View file

@ -210,9 +210,9 @@ module.exports.widgets = function(data,parent) {
widgetManager.addWidget(widgetInner)
if (scopedCss.length) {
widgetContainer.addClass('css-scope-' + widgetInner.hash)
scopedCss = scopedCss.split('${id}').join('.css-scope-' + widgetInner.hash + ' ')
widgetContainer.append(`<style>${scopedCss}</style>`)
widgetContainer.attr('id', 'widget-' + widgetInner.hash)
scopedCss = scopedCss.split('${id}').join('#widget-' + widgetInner.hash + ' ')
widgetContainer.prepend(`<style>${scopedCss}</style>`)
}
// set widget's initial state