Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Commit

Permalink
fix(DataSet): make sure the right id-type is used internaly
Browse files Browse the repository at this point in the history
This fixes a fixed strange string-number conversion issue.
It can happen that id "0" !== 0 what causes #2580.

fixes #2580
  • Loading branch information
mojoaxel committed Jan 15, 2017
1 parent 594c1db commit ef5b291
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/graph2d/08_performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ <h2>Graph2d | Performance</h2>
var graph2d = new vis.Graph2d(container, dataset, options);
</script>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions lib/DataSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ DataSet.prototype.clear = function (senderId) {
var i, len;
var ids = Object.keys(this._data);
var items = [];

for (i = 0, len = ids.length; i < len; i++) {
items.push(this._data[ids[i]]);
}
Expand Down Expand Up @@ -912,7 +912,7 @@ DataSet.prototype._getItem = function (id, types) {
}

if (!converted[this._fieldId]) {
converted[this._fieldId] = id;
converted[this._fieldId] = raw.id;
}

return converted;
Expand Down

0 comments on commit ef5b291

Please sign in to comment.