Skip to content
Snippets Groups Projects
Commit dcf82c16 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

force identifier to be int when possible

parent c6556799
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -97,6 +97,12 @@ IdentifiedElement.prototype.getId = function() {
};
IdentifiedElement.prototype.setId = function(id) {
// some elements are identfied by id that is not a number (like point on the
// map)
if (!isNaN(id)) {
id = parseInt(id);
}
this.id = id;
};
......
......@@ -41,7 +41,7 @@ LayoutAlias.prototype.getId = function() {
};
LayoutAlias.prototype.setId = function(id) {
this.id = id;
this.id = parseInt(id);
};
LayoutAlias.prototype.getValue = function() {
......
......@@ -43,7 +43,7 @@ LayoutData.prototype.getName = function() {
};
LayoutData.prototype.setId = function(id) {
this.id = id;
this.id = parseInt(id);
};
LayoutData.prototype.setName = function(name) {
......
......@@ -18,7 +18,7 @@ LayoutReaction.prototype.getId = function() {
};
LayoutReaction.prototype.setId = function(id) {
this.id = id;
this.id = parseInt(id);
};
LayoutReaction.prototype.getWidth = function() {
......
......@@ -42,7 +42,7 @@ Project.prototype.getId = function() {
};
Project.prototype.setId = function(id) {
this._id = id;
this._id = parseInt(id);
};
Project.prototype.getProjectId = function() {
return this._projectId;
......
......@@ -45,7 +45,7 @@ Reaction.prototype.getId = function() {
};
Reaction.prototype.setId = function(id) {
this.id = id;
this.id = parseInt(id);
};
Reaction.prototype.getCenter = function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment