From 7dd470ccc05d5ad481838d8c0545612391b28955 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 16 Aug 2013 14:24:36 -0400 Subject: [PATCH] Oops, make highlight in topic list style-able too --- .../discourse/views/list/topic_list_item_view.js | 11 ++++++----- .../stylesheets/application/topic-list.css.scss | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/views/list/topic_list_item_view.js b/app/assets/javascripts/discourse/views/list/topic_list_item_view.js index 2d1f6d71456..393f662b942 100644 --- a/app/assets/javascripts/discourse/views/list/topic_list_item_view.js +++ b/app/assets/javascripts/discourse/views/list/topic_list_item_view.js @@ -17,11 +17,12 @@ Discourse.TopicListItemView = Discourse.GroupedView.extend({ highlight: function() { var $topic = this.$(); var originalCol = $topic.css('backgroundColor'); - $topic.css({ - backgroundColor: "#ffffcc" - }).animate({ - backgroundColor: originalCol - }, 2500); + $topic + .addClass('highlighted') + .stop() + .animate({ backgroundColor: originalCol }, 2500, 'swing', function(){ + $topic.removeClass('highlighted'); + }); }, didInsertElement: function() { diff --git a/app/assets/stylesheets/application/topic-list.css.scss b/app/assets/stylesheets/application/topic-list.css.scss index 87a5e7b5cce..1eeb58355d2 100644 --- a/app/assets/stylesheets/application/topic-list.css.scss +++ b/app/assets/stylesheets/application/topic-list.css.scss @@ -59,6 +59,9 @@ color: $nav-pills-border-color-active; } } + &.highlighted { + background-color: $highlight; + } } th, td {