From f61c4fdf5894cafba87ec5f0458bde728573c3d8 Mon Sep 17 00:00:00 2001 From: Sebastien Curt <sebastien.curt@tetras-libre.fr> Date: Thu, 5 May 2022 11:22:01 +0200 Subject: [PATCH] Fix annotation name update --- capsule-prototype/js/PopupPanelWidget.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/capsule-prototype/js/PopupPanelWidget.js b/capsule-prototype/js/PopupPanelWidget.js index 2c720cb..f5b7cf9 100644 --- a/capsule-prototype/js/PopupPanelWidget.js +++ b/capsule-prototype/js/PopupPanelWidget.js @@ -86,10 +86,10 @@ AnnotationNamePanelEdition.prototype.closeEdition = function () { if (this.canEdit) { let newValue = this.editDiv.val(); this.editDiv.val(newValue); - if (this.tag.getMetadata('Rekall->name') !== newValue) { - this.tag.setMetadata('Rekall->name', newValue); + if (this.tag.getMetadata('Rekall->Name') !== newValue) { + this.tag.setMetadata('Rekall->Name', newValue); window.app.rekall.Rekall('pubSub').publish('tag.metadata.updated', { - metadata: "Rekall->name", + metadata: "Rekall->Name", tag: this.tag }); } @@ -179,8 +179,10 @@ function AnnotationTCPanelEdition(data) { AnnotationTCPanelEdition.prototype = Object.create(PanelEdition.prototype); AnnotationTCPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) { + // eslint-disable-next-line no-unused-vars function onlyNumber(event) { - $(this).val($(this).val().replace(/[^0-9]/g, '')); + // remove characters that are not number + $(this).val($(this).val().replace(/\D/g, '')); } let that = this; @@ -295,7 +297,7 @@ AnnotationTCPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) { } AnnotationTCPanelEdition.prototype.closeEdition = function () { if (this.canEdit) { - let isNaN = (maybeNaN) => maybeNaN!=maybeNaN; + let isNaN = (maybeNaN) => maybeNaN !== maybeNaN; let ensureNotNaN = (text, defaultValue = 0) => { let tempVal = parseInt(text); if (isNaN(tempVal)) { -- GitLab