Skip to content

Commit

Permalink
Merge pull request #5326 from archesproject/4304_duplicate_tile_values
Browse files Browse the repository at this point in the history
Fixes issue with values getting duplicated across sibling tiles.
  • Loading branch information
chiatt authored Sep 30, 2019
2 parents cee7cdf + 42be1cb commit 271d066
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions arches/app/media/js/models/card-widget.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
define([
'underscore',
'knockout',
'arches',
'knockout-mapping',
'models/abstract',
'widgets',
'utils/dispose'
], function(_, ko, koMapping, AbstractModel, widgets, dispose) {
], function(_, ko, arches, koMapping, AbstractModel, widgets, dispose) {
return AbstractModel.extend({
/**
* A backbone model to manage cards_x_nodes_x_widgets records
Expand Down Expand Up @@ -75,13 +76,15 @@ define([
return configJSON;
},
write: function(value) {
var config = this.get('config');
for (var key in value) {
if (key === 'label') {
this.get('label')(value[key]);
}
if (config[key] && config[key]() !== value[key]) {
config[key](value[key]);
if (window.location.pathname.includes(arches.urls.graph_designer(this.card.get('graph_id')))){
var config = this.get('config');
for (var key in value) {
if (key === 'label') {
this.get('label')(value[key]);
}
if (config[key] && config[key]() !== value[key]) {
config[key](value[key]);
}
}
}
},
Expand Down

0 comments on commit 271d066

Please sign in to comment.