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
f63ff690
Commit
f63ff690
authored
Jul 30, 2015
by
Chris Rodriguez
Committed by
cahrens
Sep 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assigning focus to the selected topic
TNL-2620
parent
22b3c0bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
common/static/coffee/spec/discussion/view/discussion_thread_view_spec.coffee
+12
-0
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
+1
-0
common/static/common/templates/discussion/thread.underscore
+2
-2
No files found.
common/static/coffee/spec/discussion/view/discussion_thread_view_spec.coffee
View file @
f63ff690
...
@@ -158,6 +158,18 @@ describe "DiscussionThreadView", ->
...
@@ -158,6 +158,18 @@ describe "DiscussionThreadView", ->
expect
(
$
.
ajax
).
not
.
toHaveBeenCalled
()
expect
(
$
.
ajax
).
not
.
toHaveBeenCalled
()
expect
(
@
view
.
$el
.
find
(
".responses li"
).
length
).
toEqual
(
0
)
expect
(
@
view
.
$el
.
find
(
".responses li"
).
length
).
toEqual
(
0
)
describe
"focus"
,
->
it
"sends focus to the conversation when opened"
,
->
DiscussionViewSpecHelper
.
setNextResponseContent
({
resp_total
:
0
,
children
:
[]})
@
view
.
render
()
@
view
.
expand
()
waitsFor
(
->
# This is the implementation of "toBeFocused". However, simply calling that method
# with no wait seems to be flaky.
article
=
@
view
.
$el
.
find
(
'.discussion-article'
)
return
article
[
0
]
==
article
[
0
].
ownerDocument
.
activeElement
),
"conversation did not receive focus"
,
3000
describe
"expand/collapse"
,
->
describe
"expand/collapse"
,
->
it
"shows/hides appropriate content"
,
->
it
"shows/hides appropriate content"
,
->
DiscussionViewSpecHelper
.
setNextResponseContent
({
resp_total
:
0
,
children
:
[]})
DiscussionViewSpecHelper
.
setNextResponseContent
({
resp_total
:
0
,
children
:
[]})
...
...
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
f63ff690
...
@@ -162,6 +162,7 @@ if Backbone?
...
@@ -162,6 +162,7 @@ if Backbone?
)
)
@
trigger
"thread:responses:rendered"
@
trigger
"thread:responses:rendered"
@
loadedResponses
=
true
@
loadedResponses
=
true
@
$el
.
find
(
'.discussion-article[data-id="'
+
@
model
.
id
+
'"]'
).
focus
()
# Sends focus to the discussion once the thread loads
error
:
(
xhr
,
textStatus
)
=>
error
:
(
xhr
,
textStatus
)
=>
return
if
textStatus
==
'abort'
return
if
textStatus
==
'abort'
...
...
common/static/common/templates/discussion/thread.underscore
View file @
f63ff690
<article class="discussion-article" data-id="<%- id %>">
<article class="discussion-article" data-id="<%- id %>"
tabindex="-1"
>
<div class="thread-wrapper"
tabindex="-1"
>
<div class="thread-wrapper">
<div class="forum-thread-main-wrapper">
<div class="forum-thread-main-wrapper">
<div class="thread-content-wrapper"></div>
<div class="thread-content-wrapper"></div>
<div class="post-extended-content">
<div class="post-extended-content">
...
...
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