Commit 5cb62222 by Ibrahim Awwal

A lame and ugly way of expanding and collapsing categories in the filter topic…

A lame and ugly way of expanding and collapsing categories in the filter topic dropdown on the forum.
parent 40d25acf
...@@ -5,6 +5,7 @@ if Backbone? ...@@ -5,6 +5,7 @@ if Backbone?
"click .browse": "toggleTopicDrop" "click .browse": "toggleTopicDrop"
"keydown .post-search-field": "performSearch" "keydown .post-search-field": "performSearch"
"click .sort-bar a": "sortThreads" "click .sort-bar a": "sortThreads"
"click .toggle-category": "toggleCategory"
"click .browse-topic-drop-menu": "filterTopic" "click .browse-topic-drop-menu": "filterTopic"
"click .browse-topic-drop-search-input": "ignoreClick" "click .browse-topic-drop-search-input": "ignoreClick"
"click .post-list .list-item a": "threadSelected" "click .post-list .list-item a": "threadSelected"
...@@ -372,3 +373,12 @@ if Backbone? ...@@ -372,3 +373,12 @@ if Backbone?
scrollTarget = Math.min(scrollTop - itemFromTop, scrollTop) scrollTarget = Math.min(scrollTop - itemFromTop, scrollTop)
scrollTarget = Math.max(scrollTop - itemFromTop - $(".browse-topic-drop-menu").height() + $(items[index]).height(), scrollTarget) scrollTarget = Math.max(scrollTop - itemFromTop - $(".browse-topic-drop-menu").height() + $(items[index]).height(), scrollTarget)
$(".browse-topic-drop-menu").scrollTop(scrollTarget) $(".browse-topic-drop-menu").scrollTop(scrollTarget)
toggleCategory: (event)=>
event.stopImmediatePropagation()
event.preventDefault()
console.log event.target
$elem = $(event.target)
$children = $($elem.closest('li').children('ul')[0])
$children.slideToggle(600)
\ No newline at end of file
...@@ -883,6 +883,12 @@ body.discussion { ...@@ -883,6 +883,12 @@ body.discussion {
color: #fff; color: #fff;
} }
.toggle-category {
margin: 7px 0;
float: left;
font-size: 20px;
}
.unread { .unread {
float: right; float: right;
padding: 0 5px; padding: 0 5px;
...@@ -1054,7 +1060,7 @@ body.discussion { ...@@ -1054,7 +1060,7 @@ body.discussion {
a { a {
display: block; display: block;
position: relative; position: relative;
float: left; float: left;
clear: both; clear: both;
width: 100%; width: 100%;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
</%def> </%def>
<%def name="render_category(categories, category)"> <%def name="render_category(categories, category)">
<li> <li class="dropdown-category">
<a href="#"><span class="board-name">${category}</span></a> <a href="#"><span class="toggle-category">+</span><span class="board-name">${category}</span></a>
<ul> <ul>
${render_dropdown(categories[category])} ${render_dropdown(categories[category])}
</ul> </ul>
......
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