Skip to content
Snippets Groups Projects
Commit f61c4fdf authored by Sebastien's avatar Sebastien
Browse files

Fix annotation name update

parent aa1133ec
Branches
No related tags found
1 merge request!98refresh the mosaic on annotation modification
...@@ -86,10 +86,10 @@ AnnotationNamePanelEdition.prototype.closeEdition = function () { ...@@ -86,10 +86,10 @@ AnnotationNamePanelEdition.prototype.closeEdition = function () {
if (this.canEdit) { if (this.canEdit) {
let newValue = this.editDiv.val(); let newValue = this.editDiv.val();
this.editDiv.val(newValue); this.editDiv.val(newValue);
if (this.tag.getMetadata('Rekall->name') !== newValue) { if (this.tag.getMetadata('Rekall->Name') !== newValue) {
this.tag.setMetadata('Rekall->name', newValue); this.tag.setMetadata('Rekall->Name', newValue);
window.app.rekall.Rekall('pubSub').publish('tag.metadata.updated', { window.app.rekall.Rekall('pubSub').publish('tag.metadata.updated', {
metadata: "Rekall->name", metadata: "Rekall->Name",
tag: this.tag tag: this.tag
}); });
} }
...@@ -179,8 +179,10 @@ function AnnotationTCPanelEdition(data) { ...@@ -179,8 +179,10 @@ function AnnotationTCPanelEdition(data) {
AnnotationTCPanelEdition.prototype = Object.create(PanelEdition.prototype); AnnotationTCPanelEdition.prototype = Object.create(PanelEdition.prototype);
AnnotationTCPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) { AnnotationTCPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) {
// eslint-disable-next-line no-unused-vars
function onlyNumber(event) { 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; let that = this;
...@@ -295,7 +297,7 @@ AnnotationTCPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) { ...@@ -295,7 +297,7 @@ AnnotationTCPanelEdition.prototype.appendInputEditorDiv = function (parentDiv) {
} }
AnnotationTCPanelEdition.prototype.closeEdition = function () { AnnotationTCPanelEdition.prototype.closeEdition = function () {
if (this.canEdit) { if (this.canEdit) {
let isNaN = (maybeNaN) => maybeNaN!=maybeNaN; let isNaN = (maybeNaN) => maybeNaN !== maybeNaN;
let ensureNotNaN = (text, defaultValue = 0) => { let ensureNotNaN = (text, defaultValue = 0) => {
let tempVal = parseInt(text); let tempVal = parseInt(text);
if (isNaN(tempVal)) { if (isNaN(tempVal)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment