directly render labels without angularJS template code (#14700)

This commit is contained in:
Niels Lyngsø
2023-08-22 11:27:16 +02:00
committed by kjac
parent 0dc18982ee
commit e1b4aebb0f

View File

@@ -644,6 +644,12 @@
blockObject.index = 0;
if (blockObject.config.label && blockObject.config.label !== "" && blockObject.config.unsupported !== true) {
// If the label does not contain any AngularJS template, then the MutationObserver wont give us any updates. To ensure labels without angular JS template code, we will just set the label directly for ones without '{{':
if(blockObject.config.label.indexOf("{{") === -1) {
blockObject.label = blockObject.config.label;
}
var labelElement = $('<div></div>', { text: blockObject.config.label});
var observer = new MutationObserver(function(mutations) {
@@ -673,6 +679,7 @@
this.__labelScope = Object.assign(this.__labelScope, labelVars);
$compile(labelElement.contents())(this.__labelScope);
}.bind(blockObject)
} else {
blockObject.__renderLabel = function() {};