diff --git a/frontend/src/Metamaps/DataModel/Metacode.js b/frontend/src/Metamaps/DataModel/Metacode.js index a3d523fd..f9bd06cf 100644 --- a/frontend/src/Metamaps/DataModel/Metacode.js +++ b/frontend/src/Metamaps/DataModel/Metacode.js @@ -4,7 +4,7 @@ import outdent from 'outdent' const Metacode = Backbone.Model.extend({ initialize: function () { - var image = new Image() + var image = new window.Image() image.crossOrigin = 'Anonymous' image.src = this.get('icon') this.set('image', image) diff --git a/frontend/src/Metamaps/DataModel/Synapse.js b/frontend/src/Metamaps/DataModel/Synapse.js index 2d8f4256..b9a3153b 100644 --- a/frontend/src/Metamaps/DataModel/Synapse.js +++ b/frontend/src/Metamaps/DataModel/Synapse.js @@ -11,7 +11,6 @@ import Realtime from '../Realtime' import SynapseCard from '../SynapseCard' import Visualize from '../Visualize' - /* * Dependencies: * - Metamaps.Mappings @@ -46,8 +45,7 @@ const Synapse = Backbone.Model.extend({ if (permBefore === 'private' && model.get('permission') !== 'private') { model.trigger('noLongerPrivate') - } - else if (permBefore !== 'private' && model.get('permission') === 'private') { + } else if (permBefore !== 'private' && model.get('permission') === 'private') { model.trigger('nowPrivate') } } @@ -104,8 +102,8 @@ const Synapse = Backbone.Model.extend({ return Metamaps.Topics.get(this.get('topic2_id')) }, getDirection: function () { - var t1 = this.getTopic1(), - t2 = this.getTopic2() + var t1 = this.getTopic1() + var t2 = this.getTopic2() return t1 && t2 ? [ t1.get('node').id, @@ -130,7 +128,7 @@ const Synapse = Backbone.Model.extend({ nodeTo: this.get('topic2_id'), data: { $synapses: [], - $synapseIDs: [synapseID], + $synapseIDs: [synapseID] } } @@ -167,7 +165,7 @@ const Synapse = Backbone.Model.extend({ var edge = this.get('edge') // update synapse card, if this synapse is the one open there - if (onPageWithSynapseCard && edge == SynapseCard.openSynapseCard) { + if (onPageWithSynapseCard && edge === SynapseCard.openSynapseCard) { SynapseCard.showCard(edge) } }, diff --git a/frontend/src/Metamaps/DataModel/Topic.js b/frontend/src/Metamaps/DataModel/Topic.js index 33a9bd3f..3d27814e 100644 --- a/frontend/src/Metamaps/DataModel/Topic.js +++ b/frontend/src/Metamaps/DataModel/Topic.js @@ -46,8 +46,7 @@ const Topic = Backbone.Model.extend({ if (permBefore === 'private' && model.get('permission') !== 'private') { model.trigger('noLongerPrivate') - } - else if (permBefore !== 'private' && model.get('permission') === 'private') { + } else if (permBefore !== 'private' && model.get('permission') === 'private') { model.trigger('nowPrivate') } } @@ -87,8 +86,8 @@ const Topic = Backbone.Model.extend({ authorizeToEdit: function (mapper) { if (mapper && (this.get('user_id') === mapper.get('id') || - this.get('calculated_permission') === 'commons' || - this.get('collaborator_ids').includes(mapper.get('id')))) { + this.get('calculated_permission') === 'commons' || + this.get('collaborator_ids').includes(mapper.get('id')))) { return true } else { return false @@ -148,7 +147,7 @@ const Topic = Backbone.Model.extend({ var onPageWithTopicCard = Active.Map || Active.Topic var node = this.get('node') // update topic card, if this topic is the one open there - if (onPageWithTopicCard && this == TopicCard.openTopicCard) { + if (onPageWithTopicCard && this === TopicCard.openTopicCard) { TopicCard.showCard(node) } @@ -162,7 +161,7 @@ const Topic = Backbone.Model.extend({ var onPageWithTopicCard = Active.Map || Active.Topic var node = this.get('node') // update topic card, if this topic is the one open there - if (onPageWithTopicCard && this == TopicCard.openTopicCard) { + if (onPageWithTopicCard && this === TopicCard.openTopicCard) { TopicCard.showCard(node) } }, diff --git a/frontend/src/Metamaps/DataModel/index.js b/frontend/src/Metamaps/DataModel/index.js index 4ee6d10d..45da7156 100644 --- a/frontend/src/Metamaps/DataModel/index.js +++ b/frontend/src/Metamaps/DataModel/index.js @@ -49,7 +49,7 @@ const DataModel = { Mapping: Mapping, MappingCollection: MappingCollection, - init: function() { + init: function () { var self = DataModel Metamaps.Metacodes = Metamaps.Metacodes ? new self.MetacodeCollection(Metamaps.Metacodes) : new self.MetacodeCollection() @@ -93,10 +93,6 @@ const DataModel = { } } -export { - Map, MapCollection, Mapper, MapperCollection, Mapping, MappingCollection, - Message, MessageCollection, Metacode, MetacodeCollection, - Synapse, SynapseCollection, Topic, TopicCollection -} +export { Map, MapCollection, Mapper, MapperCollection, Mapping, MappingCollection, Message, MessageCollection, Metacode, MetacodeCollection, Synapse, SynapseCollection, Topic, TopicCollection } export default DataModel