diff --git a/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js b/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js index e425229f149..c3b5260e5f7 100644 --- a/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js +++ b/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js @@ -116,22 +116,13 @@ class AAMModel extends Listener { if (this._activeAAM && this._active) { let label = this._active.label; let attrId = +this._attrIdByIdx(label, this._attrNumberByLabel[label].current); - let attrInfo = window.cvat.labelsInfo.attrInfo(attrId); let [xtl, ytl, xbr, ybr] = this._bbRect(this._currentShapes[this._activeIdx].interpolation.position); this._focus(xtl - this._margin, xbr + this._margin, ytl - this._margin, ybr + this._margin); this._active.activeAttribute = attrId; - - this.notify(); - - if (attrInfo.type === 'text' || attrInfo.type === 'number') { - this._active.aamAttributeFocus(); - } - } - else { - this.notify(); } + this.notify(); } _deactivate() { @@ -384,7 +375,5 @@ class AAMView { this._trackManagement.removeClass('hidden'); } } - // blur on change text attribute to other or on exit from aam - blurAllElements(); } } diff --git a/cvat/apps/engine/static/engine/js/shapes.js b/cvat/apps/engine/static/engine/js/shapes.js index 587f5223d03..cb510be0309 100644 --- a/cvat/apps/engine/static/engine/js/shapes.js +++ b/cvat/apps/engine/static/engine/js/shapes.js @@ -441,10 +441,6 @@ class ShapeModel extends Listener { return frame in this._positions; } - aamAttributeFocus() { - this.notify('attributeFocus'); - } - select() { if (!this._selected) { this._selected = true; @@ -2509,12 +2505,6 @@ class ShapeView extends Listener { this.notify('changelabel'); break; } - case 'attributeFocus': { - let attrId = model.activeAAM.attributeId; - this._uis.attributes[attrId].focus(); - this._uis.attributes[attrId].select(); - break; - } case 'activeAttribute': this._setupAAMView(activeAAM.shape, interpolation.position); setupHidden.call(this, hiddenShape, hiddenText, activeAAM, model.active, interpolation); @@ -2522,6 +2512,15 @@ class ShapeView extends Listener { if (activeAAM.shape && this._uis.shape) { this._uis.shape.node.dispatchEvent(new Event('click')); this._highlightAttribute(activeAAM.attributeId); + + let attrInfo = window.cvat.labelsInfo.attrInfo(activeAAM.attributeId); + if (attrInfo.type === 'text' || attrInfo.type === 'number') { + this._uis.attributes[activeAAM.attributeId].focus(); + this._uis.attributes[activeAAM.attributeId].select(); + } + else { + blurAllElements(); + } } else { this._highlightAttribute(null);