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
bb6f4cdb
Commit
bb6f4cdb
authored
Sep 17, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move dropdown filter into a more clearly named file, discussion-filter.js, and move the
event bindings into the proper views.
parent
680e681f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
50 deletions
+7
-50
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+1
-0
lms/static/coffee/src/discussion/views/new_post_view.coffee
+1
-0
lms/static/js/discussion-filter.js
+4
-47
lms/templates/discussion/_js_head_dependencies.html
+1
-0
lms/templates/discussion/index.html
+0
-2
lms/templates/discussion/single_thread.html
+0
-1
No files found.
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
bb6f4cdb
...
...
@@ -9,6 +9,7 @@ if Backbone?
"click .browse-topic-drop-search-input"
:
"ignoreClick"
"click .post-list .list-item a"
:
"threadSelected"
"click .post-list .more-pages a"
:
"loadMorePages"
'keyup .browse-topic-drop-search-input'
:
DiscussionFilter
.
filterDrop
initialize
:
->
@
displayedCollection
=
new
Discussion
(
@
collection
.
models
,
pages
:
@
collection
.
pages
)
...
...
lms/static/coffee/src/discussion/views/new_post_view.coffee
View file @
bb6f4cdb
...
...
@@ -21,6 +21,7 @@ if Backbone?
"click .topic_dropdown_button"
:
"toggleTopicDropdown"
"click .topic_menu_wrapper"
:
"setTopic"
"click .topic_menu_search"
:
"ignoreClick"
"keyup .form-topic-drop-search-input"
:
DiscussionFilter
.
filterDrop
# 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.
...
...
lms/static/js/discussion
s-temp
.js
→
lms/static/js/discussion
-filter
.js
View file @
bb6f4cdb
var
$body
;
var
$browse
;
var
$search
;
var
$searchField
;
var
$currentBoard
;
var
$newPost
;
var
$sidebar
;
var
$sidebarWidthStyles
;
var
$postListWrapper
;
var
$discussionBody
;
var
sidebarWidth
;
var
sidebarXOffset
;
var
scrollTop
;
$
(
document
).
ready
(
function
()
{
$body
=
$
(
'body'
);
//$browse = $('.browse-search .browse');
//$search = $('.browse-search .search');
$searchField
=
$
(
'.post-search-field'
);
//$topicDrop = $('.browse-topic-drop-menu-wrapper');
$currentBoard
=
$
(
'.current-board'
);
$newPost
=
$
(
'.new-post-article'
);
$sidebar
=
$
(
'.sidebar'
);
$discussionBody
=
$
(
'.discussion-body'
);
$postListWrapper
=
$
(
'.post-list-wrapper'
);
// $dropFilter = $('.browse-topic-drop-search-input');
// $topicFilter = $('.topic-drop-search-input');
$sidebarWidthStyles
=
$
(
'<style></style>'
);
$body
.
append
(
$sidebarWidthStyles
);
sidebarWidth
=
$
(
'.sidebar'
).
width
();
sidebarXOffset
=
$sidebar
.
offset
().
top
;
//$browse.bind('click', showTopicDrop);
//$search.bind('click', showSearch);
// $topicDrop.bind('click', setTopic);
// $formTopicDropBtn.bind('click', showFormTopicDrop);
// $formTopicDropMenu.bind('click', setFormTopic);
$body
.
delegate
(
'.browse-topic-drop-search-input, .form-topic-drop-search-input'
,
'keyup'
,
filterDrop
);
});
function
filterDrop
(
e
)
{
var
DiscussionFilter
=
DiscussionFilter
||
{};
DiscussionFilter
.
filterDrop
=
function
(
e
)
{
/*
* multiple queries
*/
...
...
@@ -90,7 +47,7 @@ function filterDrop(e) {
* single query
*/
var
$drop
=
$
(
e
.
target
).
parents
(
'.topic_menu_wrapper, .browse-topic-drop-menu-wrapper'
);
var
query
=
$
(
this
).
val
();
var
query
=
$
(
e
.
target
).
val
();
var
$items
=
$drop
.
find
(
'a'
);
if
(
query
.
length
==
0
)
{
...
...
lms/templates/discussion/_js_head_dependencies.html
View file @
bb6f4cdb
...
...
@@ -13,6 +13,7 @@
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/underscore-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/backbone-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/tooltips.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/discussion-filter.js')}"
></script>
<link
href=
"${static.url('css/vendor/jquery.tagsinput.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"${static.url('css/vendor/jquery.autocomplete.css')}"
rel=
"stylesheet"
type=
"text/css"
>
lms/templates/discussion/index.html
View file @
bb6f4cdb
...
...
@@ -21,8 +21,6 @@
<
%
include
file=
"_new_post.html"
/>
<script
type=
"text/javascript"
src=
"${static.url('js/discussions-temp.js')}"
></script>
<section
class=
"discussion container"
id=
"discussion-container"
data-roles=
"${roles}"
data-course-id=
"${course_id}"
data-user-info=
"${user_info}"
data-threads=
"${threads}"
data-thread-pages=
"${thread_pages}"
>
<div
class=
"discussion-body"
>
<div
class=
"sidebar"
></div>
...
...
lms/templates/discussion/single_thread.html
View file @
bb6f4cdb
...
...
@@ -16,7 +16,6 @@
<
%
block
name=
"js_extra"
>
<
%
include
file=
"_js_body_dependencies.html"
/>
<
%
static:js
group=
'discussion'
/>
<script
type=
"text/javascript"
src=
"${static.url('js/discussions-temp.js')}"
></script>
</
%
block>
...
...
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