Commit 7287e8ef by Andy Armstrong

Fix a number of styling bugs

parent dcafb1e4
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
DiscussionThreadListView.prototype.initialize = function(options) { DiscussionThreadListView.prototype.initialize = function(options) {
var self = this; var self = this;
this.courseSettings = options.courseSettings; this.courseSettings = options.courseSettings;
this.supportsActiveThread = options.supportsActiveThread;
this.displayedCollection = new Discussion(this.collection.models, { this.displayedCollection = new Discussion(this.collection.models, {
pages: this.collection.pages pages: this.collection.pages
}); });
...@@ -164,7 +165,7 @@ ...@@ -164,7 +165,7 @@
active = $currentElement.has('.forum-nav-thread-link.is-active').length !== 0; active = $currentElement.has('.forum-nav-thread-link.is-active').length !== 0;
$currentElement.replaceWith($content); $currentElement.replaceWith($content);
this.showMetadataAccordingToSort(); this.showMetadataAccordingToSort();
if (active) { if (this.supportsActiveThread && active) {
this.setActiveThread(threadId); this.setActiveThread(threadId);
} }
}; };
...@@ -347,7 +348,9 @@ ...@@ -347,7 +348,9 @@
DiscussionThreadListView.prototype.threadSelected = function(e) { DiscussionThreadListView.prototype.threadSelected = function(e) {
var threadId; var threadId;
threadId = $(e.target).closest('.forum-nav-thread').attr('data-id'); threadId = $(e.target).closest('.forum-nav-thread').attr('data-id');
this.setActiveThread(threadId); if (this.supportsActiveThread) {
this.setActiveThread(threadId);
}
this.trigger('thread:selected', threadId); this.trigger('thread:selected', threadId);
return false; return false;
}; };
......
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
this.discussionThreadListView = new DiscussionThreadListView({ this.discussionThreadListView = new DiscussionThreadListView({
collection: this.discussion, collection: this.discussion,
el: this.$('.discussion-thread-list-container'), el: this.$('.discussion-thread-list-container'),
courseSettings: this.courseSettings courseSettings: this.courseSettings,
supportsActiveThread: true
}).render(); }).render();
this.searchView = new DiscussionSearchView({ this.searchView = new DiscussionSearchView({
el: this.$('.forum-search') el: this.$('.forum-search')
......
// discussion - elements - labels // discussion - elements - labels
// ==================== // ====================
body.discussion, .discussion-module { .forum-nav-thread {
.post-label { .post-label {
@include margin($baseline/4, $baseline/2, 0, 0); @include margin($baseline/4, $baseline/2, 0, 0);
@extend %t-weight4; @extend %t-weight4;
......
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
@include padding-left(0); @include padding-left(0);
list-style: none; list-style: none;
li { .forum-nav-thread {
margin: 0; margin: 0;
} }
} }
...@@ -239,6 +239,10 @@ ...@@ -239,6 +239,10 @@
background-color: $forum-color-hover-thread; background-color: $forum-color-hover-thread;
} }
&.is-active {
background-color: $forum-color-reading-thread;
}
.forum-nav-thread-unread-comments-count { .forum-nav-thread-unread-comments-count {
display: inline-block; display: inline-block;
font-size: $forum-small-font-size; font-size: $forum-small-font-size;
...@@ -246,8 +250,6 @@ ...@@ -246,8 +250,6 @@
} }
} }
.discussion:not(.inline-discussion)
&.never-read { &.never-read {
.forum-nav-thread-link { .forum-nav-thread-link {
@include border-left(3px solid $forum-color-never-read-post); @include border-left(3px solid $forum-color-never-read-post);
...@@ -256,40 +258,6 @@ ...@@ -256,40 +258,6 @@
} }
} }
.discussion.discussion-board {
.forum-nav-thread {
.forum-nav-thread-link.is-active {
color: $forum-color-background;
background-color: $forum-color-reading-thread;
.forum-nav-thread-labels > li {
border-color: $forum-color-background;
color: $forum-color-background;
}
.forum-nav-thread-votes-count {
color: $forum-color-background;
}
.forum-nav-thread-comments-count {
color: $base-font-color;
&:after {
@include border-right-color($forum-color-border);
}
}
span.icon {
color: $forum-color-background;
}
.thread-preview-body {
color: $forum-color-background;
}
}
}
}
%forum-nav-thread-wrapper { %forum-nav-thread-wrapper {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
......
...@@ -20,8 +20,8 @@ $forum-color-border: $gray-l3 !default; ...@@ -20,8 +20,8 @@ $forum-color-border: $gray-l3 !default;
$forum-color-error: $red !default; $forum-color-error: $red !default;
$forum-color-hover-thread: #f6f6f6 !default; $forum-color-hover-thread: #f6f6f6 !default;
$forum-color-reading-thread: $gray-d3 !default; $forum-color-reading-thread: $gray-d3 !default;
$forum-color-read-post: $forum-color-primary !default; $forum-color-read-post: $gray-d3 !default;
$forum-color-never-read-post: $gray-d3 !default; $forum-color-never-read-post: $forum-color-primary !default;
$forum-color-editor-preview-label: $gray-d2 !default; $forum-color-editor-preview-label: $gray-d2 !default;
$forum-color-response-count: $gray-d2 !default; $forum-color-response-count: $gray-d2 !default;
$forum-color-navigation-bar: #f6f6f6 !default; $forum-color-navigation-bar: #f6f6f6 !default;
......
...@@ -19,7 +19,7 @@ $forum-color-marked-answer: palette(success, text) !default; ...@@ -19,7 +19,7 @@ $forum-color-marked-answer: palette(success, text) !default;
$forum-color-border: palette(grayscale, back) !default; $forum-color-border: palette(grayscale, back) !default;
$forum-color-error: palette(error, accent) !default; $forum-color-error: palette(error, accent) !default;
$forum-color-hover-thread: palette(grayscale, x-back) !default; $forum-color-hover-thread: palette(grayscale, x-back) !default;
$forum-color-reading-thread: $forum-color-primary !default; $forum-color-reading-thread: palette(grayscale, x-back) !default;
$forum-color-read-post: palette(grayscale, base) !default; $forum-color-read-post: palette(grayscale, base) !default;
$forum-color-never-read-post: $forum-color-primary !default; $forum-color-never-read-post: $forum-color-primary !default;
$forum-color-editor-preview-label: palette(grayscale, base) !default; $forum-color-editor-preview-label: palette(grayscale, base) !default;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment