Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
52e780e0
Commit
52e780e0
authored
Sep 03, 2012
by
Arjun Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add all filter
parent
629a8e7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+13
-5
lms/templates/discussion/_filter_dropdown.html
+5
-0
No files found.
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
52e780e0
...
...
@@ -6,10 +6,17 @@ class @DiscussionThreadListView extends Backbone.View
"keyup .post-search-field"
:
"performSearch"
"click .sort-bar a"
:
"sortThreads"
"click .browse-topic-drop-menu"
:
"filterTopic"
"click .browse-topic-drop-search-input"
:
"ignoreClick"
initialize
:
->
@
displayedCollection
=
new
Discussion
(
@
collection
.
models
)
# Because we want the behavior that when the body is clicked the menu is
# closed, we need to ignore clicks in the search field and stop propagation.
# Without this, clicking the search field would also close the menu.
ignoreClick
:
(
event
)
->
event
.
stopPropagation
()
render
:
->
@
timer
=
0
@
$el
.
html
(
@
template
())
...
...
@@ -41,16 +48,15 @@ class @DiscussionThreadListView extends Backbone.View
@
$
(
".browse"
).
removeClass
(
'is-open'
)
setTimeout
(
->
@
$
(
".post-search-field"
).
focus
()),
200
toggleTopicDrop
:
=>
toggleTopicDrop
:
(
event
)
=>
event
.
stopPropagation
()
@
$
(
".browse"
).
toggleClass
(
'is-dropped'
)
if
@
$
(
".browse"
).
hasClass
(
'is-dropped'
)
@
$
(
".browse-topic-drop-menu-wrapper"
).
show
()
setTimeout
((
=>
$
(
"body"
).
bind
(
"click"
,
@
toggleTopicDrop
)
),
0
)
$
(
'body'
).
bind
'click'
,
@
toggleTopicDrop
else
@
$
(
".browse-topic-drop-menu-wrapper"
).
hide
()
$
(
"body"
).
unbind
(
"click"
,
@
toggleTopicDrop
)
$
(
'body'
).
unbind
'click'
,
@
toggleTopicDrop
setTopic
:
(
event
)
->
item
=
$
(
event
.
target
).
closest
(
'a'
)
...
...
@@ -70,6 +76,8 @@ class @DiscussionThreadListView extends Backbone.View
filterTopic
:
(
event
)
->
@
setTopic
(
event
)
item
=
$
(
event
.
target
).
closest
(
'li'
)
if
item
.
find
(
"span.board-name"
).
data
(
"discussion_id"
)
==
"#all"
item
=
item
.
parent
()
discussionIds
=
_
.
compact
_
.
map
item
.
find
(
"span.board-name"
),
(
board
)
->
$
(
board
).
data
(
"discussion_id"
)
discussionIds
=
_
.
map
discussionIds
,
(
info
)
->
info
.
id
filtered
=
@
collection
.
filter
(
thread
)
=>
...
...
lms/templates/discussion/_filter_dropdown.html
View file @
52e780e0
...
...
@@ -28,6 +28,11 @@
<input
type=
"text"
class=
"browse-topic-drop-search-input"
placeholder=
"filter topics"
>
</div>
<ul
class=
"browse-topic-drop-menu"
>
<li>
<a
href=
"#"
>
<span
class=
"board-name"
data-discussion_id=
'#all'
>
All
</span>
<span
class=
"unread"
>
1,248
</span>
</a>
</li>
${render_dropdown(category_map)}
</ul>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment