diff --git a/app/assets/javascripts/app/views.js b/app/assets/javascripts/app/views.js index 607e02afd..001ad5840 100644 --- a/app/assets/javascripts/app/views.js +++ b/app/assets/javascripts/app/views.js @@ -121,11 +121,13 @@ app.views.Base = Backbone.View.extend({ var url = this.model.urlRoot + '/' + this.model.id; if (confirm(Diaspora.I18n.t("confirm_dialog"))) { + this.$el.addClass('deleting'); this.model.destroy({ url: url }) .done(function() { self.remove(); }) .fail(function() { + self.$el.removeClass('deleting'); var flash = new Diaspora.Widgets.FlashMessages; flash.render({ success: false, diff --git a/app/assets/javascripts/app/views/photo_view.js b/app/assets/javascripts/app/views/photo_view.js index 953a6f8e0..0e215086d 100644 --- a/app/assets/javascripts/app/views/photo_view.js +++ b/app/assets/javascripts/app/views/photo_view.js @@ -14,7 +14,6 @@ app.views.Photo = app.views.Base.extend({ initialize : function() { $(this.el).attr("id", this.model.get("guid")); - this.model.bind('remove', this.remove, this); return this; }, diff --git a/app/assets/stylesheets/stream_element.css.scss b/app/assets/stylesheets/stream_element.css.scss index e8d9b4d87..e0eea4298 100644 --- a/app/assets/stylesheets/stream_element.css.scss +++ b/app/assets/stylesheets/stream_element.css.scss @@ -6,6 +6,10 @@ & > .media { margin: 0px; } + &.deleting { + > .media { opacity: 0.3; } + .controls { display: none !important; } + } } #main_stream .stream_element { diff --git a/features/desktop/profile_photos.feature b/features/desktop/profile_photos.feature index 324e1efe5..02039a25e 100644 --- a/features/desktop/profile_photos.feature +++ b/features/desktop/profile_photos.feature @@ -31,5 +31,6 @@ Feature: show photos When I am on "robert@grimm.grimm"'s photos page And I delete a photo And I confirm the alert - And I am on "robert@grimm.grimm"'s page + Then I should not see ".deleting" within ".stream" + When I am on "robert@grimm.grimm"'s page Then I should not see "Photos" within "#profile_horizontal_bar"