diff options
Diffstat (limited to 'app/assets/javascripts/content_editor/extensions/reference_label.js')
-rw-r--r-- | app/assets/javascripts/content_editor/extensions/reference_label.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/assets/javascripts/content_editor/extensions/reference_label.js b/app/assets/javascripts/content_editor/extensions/reference_label.js index 0441f8ef8d2..9cd55a0f87c 100644 --- a/app/assets/javascripts/content_editor/extensions/reference_label.js +++ b/app/assets/javascripts/content_editor/extensions/reference_label.js @@ -4,7 +4,7 @@ import LabelWrapper from '../components/wrappers/reference_label.vue'; import Reference from './reference'; export default Reference.extend({ - name: 'reference_label', + name: 'referenceLabel', addAttributes() { return { @@ -20,11 +20,21 @@ export default Reference.extend({ }, color: { default: null, - parseHTML: (element) => element.querySelector('.gl-label-text').style.backgroundColor, + parseHTML: (element) => { + let color = element.querySelector('.gl-label-text').style.backgroundColor; + if (!color || color.startsWith('var')) + color = element.style.getPropertyValue('--label-background-color'); + + return color; + }, }, }; }, + addInputRules() { + return []; + }, + parseHTML() { return [{ tag: 'span.gl-label' }]; }, |