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
77ccf688
Commit
77ccf688
authored
Apr 17, 2014
by
Diana Huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3386 from edx/hotfix/2014-04-17
Show full body when expanding inline forum thread
parents
3a7c3e7c
862a16ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
common/static/coffee/spec/discussion/view/discussion_thread_view_inline_spec.coffee
+13
-0
common/static/coffee/src/discussion/views/discussion_thread_view_inline.coffee
+2
-0
No files found.
common/static/coffee/spec/discussion/view/discussion_thread_view_inline_spec.coffee
View file @
77ccf688
...
@@ -5,6 +5,7 @@ describe "DiscussionThreadInlineView", ->
...
@@ -5,6 +5,7 @@ describe "DiscussionThreadInlineView", ->
<script type="text/template" id="_inline_thread">
<script type="text/template" id="_inline_thread">
<article class="discussion-article">
<article class="discussion-article">
<div class="non-cohorted-indicator"/>
<div class="non-cohorted-indicator"/>
<div class="post-body"/>
<div class="post-extended-content">
<div class="post-extended-content">
<div class="response-count"/>
<div class="response-count"/>
<ol class="responses"/>
<ol class="responses"/>
...
@@ -19,6 +20,7 @@ describe "DiscussionThreadInlineView", ->
...
@@ -19,6 +20,7 @@ describe "DiscussionThreadInlineView", ->
<script type="text/template" id="_inline_thread_cohorted">
<script type="text/template" id="_inline_thread_cohorted">
<article class="discussion-article">
<article class="discussion-article">
<div class="cohorted-indicator"/>
<div class="cohorted-indicator"/>
<div class="post-body"/>
<div class="post-extended-content">
<div class="post-extended-content">
<div class="response-count"/>
<div class="response-count"/>
<ol class="responses"/>
<ol class="responses"/>
...
@@ -87,3 +89,14 @@ describe "DiscussionThreadInlineView", ->
...
@@ -87,3 +89,14 @@ describe "DiscussionThreadInlineView", ->
assertExpandedContentVisible
(
@
view
,
true
)
assertExpandedContentVisible
(
@
view
,
true
)
@
view
.
collapsePost
()
@
view
.
collapsePost
()
assertExpandedContentVisible
(
@
view
,
false
)
assertExpandedContentVisible
(
@
view
,
false
)
it
"switches between the abbreviated and full body"
,
->
DiscussionViewSpecHelper
.
setNextResponseContent
({
resp_total
:
0
,
children
:
[]})
@
thread
.
set
(
"body"
,
new
Array
(
100
).
join
(
"test "
))
@
view
.
abbreviateBody
()
expect
(
@
thread
.
get
(
"body"
)).
not
.
toEqual
(
@
thread
.
get
(
"abbreviatedBody"
))
@
view
.
render
()
@
view
.
expandPost
()
expect
(
@
view
.
$el
.
find
(
".post-body"
).
text
()).
toEqual
(
@
thread
.
get
(
"body"
))
@
view
.
collapsePost
()
expect
(
@
view
.
$el
.
find
(
".post-body"
).
text
()).
toEqual
(
@
thread
.
get
(
"abbreviatedBody"
))
common/static/coffee/src/discussion/views/discussion_thread_view_inline.coffee
View file @
77ccf688
...
@@ -45,6 +45,7 @@ if Backbone?
...
@@ -45,6 +45,7 @@ if Backbone?
expandPost
:
(
event
)
=>
expandPost
:
(
event
)
=>
@
$el
.
addClass
(
'expanded'
)
@
$el
.
addClass
(
'expanded'
)
@
$el
.
find
(
'.post-body'
).
html
(
@
model
.
get
(
'body'
))
@
$el
.
find
(
'.expand-post'
).
css
(
'display'
,
'none'
)
@
$el
.
find
(
'.expand-post'
).
css
(
'display'
,
'none'
)
@
$el
.
find
(
'.collapse-post'
).
css
(
'display'
,
'block'
)
@
$el
.
find
(
'.collapse-post'
).
css
(
'display'
,
'block'
)
@
$el
.
find
(
'.post-extended-content'
).
show
()
@
$el
.
find
(
'.post-extended-content'
).
show
()
...
@@ -58,6 +59,7 @@ if Backbone?
...
@@ -58,6 +59,7 @@ if Backbone?
if
postTop
<
curScroll
if
postTop
<
curScroll
$
(
'html, body'
).
animate
({
scrollTop
:
postTop
})
$
(
'html, body'
).
animate
({
scrollTop
:
postTop
})
@
$el
.
removeClass
(
'expanded'
)
@
$el
.
removeClass
(
'expanded'
)
@
$el
.
find
(
'.post-body'
).
html
(
@
model
.
get
(
'abbreviatedBody'
))
@
$el
.
find
(
'.expand-post'
).
css
(
'display'
,
'block'
)
@
$el
.
find
(
'.expand-post'
).
css
(
'display'
,
'block'
)
@
$el
.
find
(
'.collapse-post'
).
css
(
'display'
,
'none'
)
@
$el
.
find
(
'.collapse-post'
).
css
(
'display'
,
'none'
)
@
$el
.
find
(
'.post-extended-content'
).
hide
()
@
$el
.
find
(
'.post-extended-content'
).
hide
()
...
...
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