app/assets/javascript/pageflow/linkmap_page/editor/models/area.js in pageflow-linkmap-page-2.0.0 vs app/assets/javascript/pageflow/linkmap_page/editor/models/area.js in pageflow-linkmap-page-2.1.0
- old
+ new
@@ -83,11 +83,12 @@
},
unsetMask: function() {
this.set({
marker: 'no_marker',
- mask_perma_id: undefined
+ mask_perma_id: undefined,
+ color_map_component_id: undefined
});
this.trigger('change:dimensions');
},
setDimensions: function(left, top, width, height) {
@@ -117,7 +118,20 @@
return this.collection.page.id;
},
remove: function() {
this.collection.remove(this);
+ },
+
+ get: function(attr) {
+ if (attr === 'color_map_component_id') {
+ var colorMapComponentId = this.attributes['color_map_component_id'];
+ if(colorMapComponentId === undefined) {
+ // also try legacy mask_perma_id as fallback
+ colorMapComponentId = this.attributes['mask_perma_id'];
+ }
+ return colorMapComponentId;
+ } else {
+ return this.attributes[attr];
+ }
}
});