Skip to content

Instantly share code, notes, and snippets.

@fastfrwrd
Created August 15, 2014 18:01
Show Gist options
  • Save fastfrwrd/a0e8ee27d17686adc563 to your computer and use it in GitHub Desktop.
Save fastfrwrd/a0e8ee27d17686adc563 to your computer and use it in GitHub Desktop.
diff --git a/public/resources/application/rm/modules/propertylist/collection.js b/public/resources/application/rm/modules/propertylist/collection.js
index 1c4fa6b..7be150b 100644
--- a/public/resources/application/rm/modules/propertylist/collection.js
+++ b/public/resources/application/rm/modules/propertylist/collection.js
@@ -27,7 +27,7 @@ function(Backbone, _, Model, CurrentProperty){
}
};
- $(window).on('setCurrentProperty', that.setCurrentPropertyFromEvent);
+ $(window).on('setCurrentProperty', _.bind(that.setCurrentPropertyFromEvent, that));
that.on('sync', _singleProperty);
_singleProperty();
},
@@ -119,14 +119,11 @@ function(Backbone, _, Model, CurrentProperty){
/* set Current Property from 'setCurrentProperty' event */
setCurrentPropertyFromEvent: function(event, data) {
- var model, listingId;
+ var model;
- if(data && data.model) {
- model = data.model;
- listingId = [model.site, model.listing, model.unit].join('.');
-
- CurrentProperty.set(model);
- $(window).trigger('propertySelected', { listingId: listingId });
+ if (data && data.model) {
+ model = this.findWhere({druid: data.model.druid});
+ this.setCurrentProperty(model);
}
return CurrentProperty;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment