diff --git a/Gemfile.lock b/Gemfile.lock index e84100d7a..5b61087e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,13 +13,6 @@ GIT specs: settingslogic (2.0.8) -GIT - remote: git://github.com/diaspora/acts-as-taggable-on.git - revision: c3592fe1a906f6ff1cd12766c5cf1152c51eec40 - specs: - acts-as-taggable-on (2.0.6) - rails (>= 3.0) - GIT remote: git://github.com/diaspora/diaspora-client.git revision: 99dd3728172834b01e2acae0604fe3865456d969 @@ -80,6 +73,8 @@ GEM activesupport (= 3.1.4) activesupport (3.1.4) multi_json (~> 1.0) + acts-as-taggable-on (2.2.2) + rails (~> 3.0) acts_as_api (0.3.11) activemodel (>= 3.0.0) activesupport (>= 3.0.0) @@ -501,7 +496,7 @@ DEPENDENCIES SystemTimer (= 1.2.3) active_reload activerecord-import (~> 0.2.9) - acts-as-taggable-on! + acts-as-taggable-on (~> 2.2.2) acts_as_api addressable (= 2.2.4) airbrake diff --git a/app/assets/javascripts/app/models/post.js b/app/assets/javascripts/app/models/post.js index 96657900d..0f3b2b771 100644 --- a/app/assets/javascripts/app/models/post.js +++ b/app/assets/javascripts/app/models/post.js @@ -40,9 +40,11 @@ app.models.Post = Backbone.Model.extend(_.extend({}, app.models.formatDateMixin, } }, - toggleFavorite : function(){ + toggleFavorite : function(options){ this.set({favorite : !this.get("favorite")}) - this.save() + + /* guard against attempting to save a model that a user doesn't own */ + if(options.save){ this.save() } }, like : function() { diff --git a/app/assets/javascripts/app/views/small_frame.js b/app/assets/javascripts/app/views/small_frame.js index 0de60cad6..0061621e5 100644 --- a/app/assets/javascripts/app/views/small_frame.js +++ b/app/assets/javascripts/app/views/small_frame.js @@ -91,7 +91,8 @@ app.views.SmallFrame = app.views.Post.extend({ } var prevDimension = this.dimensionsClass(); - this.model.toggleFavorite(); + + this.model.toggleFavorite({save : this.model.get("author").diaspora_id == app.currentUser.get("diaspora_id")}) this.$el.removeClass(prevDimension) this.render() @@ -99,7 +100,6 @@ app.views.SmallFrame = app.views.Post.extend({ app.page.stream.trigger("reLayout") //trigger moar relayouts in the case of images WHOA GROSS HAX _.delay(function(){app.page.stream.trigger("reLayout")}, 200) - _.delay(function(){app.page.stream.trigger("reLayout")}, 500) }, killPost : function(){