diff --git a/capsule-prototype/js/PopupPanelWidget.js b/capsule-prototype/js/PopupPanelWidget.js index eceb3ac31919de996ca7b1fb7aa1d77d3756c492..cef0a810ab947b7fd0b5a0499152a8c5ec0fc1e6 100644 --- a/capsule-prototype/js/PopupPanelWidget.js +++ b/capsule-prototype/js/PopupPanelWidget.js @@ -663,6 +663,12 @@ AnnotationTagPanelEdition.prototype = Object.create(PanelEdition.prototype); AnnotationTagPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) { let that = this; + let _labels = getProjectLabels(this.tag); + let tagLabels = that.tag.getLabels(); + + if (!this.canEdit && (!tagLabels || tagLabels.length === 0)){ + return; + } function getProjectLabels(tag) { return tag.document.getLabels(); } @@ -740,8 +746,7 @@ AnnotationTagPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) .addClass('flex-col popupInput popupInputNoHide') .attr('id', 'popupLabelsInput'); - let _labels = getProjectLabels(this.tag); - let tagLabels = that.tag.getLabels(); + for (let currentLabel of _labels) { if (!this.canEdit && !tagLabels.includes(currentLabel)) continue;