mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
Convert boolean to opts object
This commit is contained in:
parent
d8165d7cee
commit
754e3b2287
1 changed files with 3 additions and 3 deletions
|
@ -113,12 +113,12 @@ export default Ember.Component.extend(StringBuffer, {
|
|||
}
|
||||
},
|
||||
|
||||
highlight(isLastViewedTopic = false) {
|
||||
highlight(opts = { isLastViewedTopic: false }) {
|
||||
const $topic = this.$();
|
||||
const originalCol = $topic.css('backgroundColor');
|
||||
$topic
|
||||
.addClass('highlighted')
|
||||
.attr('data-islastviewedtopic', isLastViewedTopic)
|
||||
.attr('data-islastviewedtopic', opts.isLastViewedTopic)
|
||||
.stop()
|
||||
.animate({ backgroundColor: originalCol }, 2500, 'swing', function() {
|
||||
$topic.removeClass('highlighted');
|
||||
|
@ -129,7 +129,7 @@ export default Ember.Component.extend(StringBuffer, {
|
|||
// highlight the last topic viewed
|
||||
if (this.session.get('lastTopicIdViewed') === this.get('topic.id')) {
|
||||
this.session.set('lastTopicIdViewed', null);
|
||||
this.highlight(true);
|
||||
this.highlight({ isLastViewedTopic: true });
|
||||
} else if (this.get('topic.highlight')) {
|
||||
// highlight new topics that have been loaded from the server or the one we just created
|
||||
this.set('topic.highlight', false);
|
||||
|
|
Loading…
Reference in a new issue