Commit 1077fc90 authored by Randall Leeds's avatar Randall Leeds

Revert "Merge pull request #2337 from hypothesis/thread-collapsing"

This reverts commit 0c6bd1b36e234c43cfdb15edac1d06792c6f259a, reversing
changes made to 0ffdda5d6d144d184348574ada953354100788c6.
parent 44539de9
......@@ -84,9 +84,6 @@ describe 'thread', ->
after = controller.collapsed
assert.equal(before, !after)
it 'defaults to collapsed if it is a top level annotation', ->
assert.isTrue(controller.collapsed)
it 'can accept an argument to force a particular state', ->
controller.toggleCollapsed(true)
assert.isTrue(controller.collapsed)
......@@ -97,12 +94,14 @@ describe 'thread', ->
controller.toggleCollapsed(false)
assert.isFalse(controller.collapsed)
it 'allows collapsing the thread even if there are no replies', ->
it 'does not allow uncollapsing the thread if there are no replies', ->
count.withArgs('message').returns(1)
controller.toggleCollapsed()
assert.isFalse(controller.collapsed)
assert.isTrue(controller.collapsed)
controller.toggleCollapsed()
assert.isTrue(controller.collapsed)
controller.toggleCollapsed(false)
assert.isTrue(controller.collapsed)
describe '#shouldShowAsReply', ->
count = null
......
......@@ -33,6 +33,11 @@ ThreadController = [
!!value
else
not @collapsed
# We only allow uncollapsing of the thread if there are some replies to
# display.
if newval == false and this.numReplies() <= 0
return
@collapsed = newval
###*
......@@ -194,11 +199,6 @@ module.exports = [
ctrl.counter = counter
ctrl.filter = filter
# If annotation is a reply, it should be uncollapsed so that when
# shown, replies don't have to be individually expanded.
if ctrl.parent?
ctrl.collapsed = false
# Track the number of messages in the thread
if counter?
counter.count 'message', 1
......
......@@ -18,10 +18,7 @@
}
.annotation-timestamp {
float: right;
font-size: .8em;
line-height: 1;
margin-top: (1 / (1 - .8)) * .1em; // scale up .1em offset to align baseline
line-height: 2;
color: $text-color;
&:hover { color: $link-color-hover; }
&:focus { outline: 0; }
......@@ -165,24 +162,3 @@ privacy {
color: $text-color;
}
}
.annotation-collapsed-replies {
display: none;
}
.annotation.collapsed {
margin-bottom: 0;
.annotation-header {
margin: 0;
}
.annotation-body, .tags, .annotation-actions, .annotation-footer {
display: none;
}
.annotation-collapsed-replies {
display: inline;
}
}
$thread-padding: 1em;
$threadexp-width: 1em;
.stream-list {
& > * {
......@@ -15,11 +16,14 @@ $thread-padding: 1em;
}
}
.thread-replies .thread:first-child {
margin-top: 0.5em;
.thread-replies {
.thread:first-child {
margin-top: 0.5em;
}
}
.thread {
@include pie-clearfix;
cursor: pointer;
position: relative;
......@@ -47,18 +51,27 @@ $thread-padding: 1em;
}
.threadexp {
background: $white;
color: $gray-light;
position: absolute;
left: -.7em;
width: 1.4em;
height: 1.4em;
font-size: 1.1em;
top: 0;
left: -.7em;
span {
background: $white;
color: $gray-light;
display: block;
line-height: inherit;
text-align: center;
position: absolute;
top: (1.4 - $threadexp-width) / 2;
left: (1.4 - $threadexp-width) / 2;
width: $threadexp-width;
height: $threadexp-width;
&:before {
font-size: $threadexp-width;
position: absolute;
top: 0;
left: 0;
}
}
}
}
......
{
"IcoMoonType": "selection",
"icons": [
{
"icon": {
"paths": [
"M426.667 725.333l213.333-213.333-213.333-213.333z"
],
"attrs": [],
"isMulticolor": false,
"tags": [
"arrow-right"
],
"grid": 24
},
"attrs": [],
"properties": {
"order": 65,
"id": 1305,
"prevSize": 24,
"code": 58909,
"name": "arrow-right"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 0
},
{
"icon": {
"paths": [
"M298.667 426.667l213.333 213.333 213.333-213.333z"
],
"attrs": [],
"isMulticolor": false,
"tags": [
"arrow-drop-down"
],
"grid": 24
},
"attrs": [],
"properties": {
"order": 68,
"id": 1303,
"prevSize": 24,
"code": 58921,
"name": "arrow-drop-down"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 2
},
{
"icon": {
"paths": [
......@@ -69,9 +21,9 @@
"code": 58920,
"name": "link"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 3
"setIdx": 0,
"setId": 6,
"iconIdx": 271
},
{
"icon": {
......@@ -94,8 +46,8 @@
"code": 58919
},
"setIdx": 2,
"setId": 1,
"iconIdx": 4
"setId": 4,
"iconIdx": 0
},
{
"icon": {
......@@ -118,8 +70,8 @@
"name": "delete"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 5
"setId": 4,
"iconIdx": 1
},
{
"icon": {
......@@ -142,8 +94,8 @@
"name": "remove"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 6
"setId": 4,
"iconIdx": 2
},
{
"icon": {
......@@ -166,8 +118,8 @@
"name": "edit"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 7
"setId": 4,
"iconIdx": 3
},
{
"icon": {
......@@ -190,8 +142,8 @@
"code": 58880
},
"setIdx": 2,
"setId": 1,
"iconIdx": 8
"setId": 4,
"iconIdx": 4
},
{
"icon": {
......@@ -214,8 +166,8 @@
"code": 58881
},
"setIdx": 2,
"setId": 1,
"iconIdx": 9
"setId": 4,
"iconIdx": 5
},
{
"icon": {
......@@ -238,8 +190,8 @@
"code": 58882
},
"setIdx": 2,
"setId": 1,
"iconIdx": 10
"setId": 4,
"iconIdx": 6
},
{
"icon": {
......@@ -262,8 +214,8 @@
"code": 58883
},
"setIdx": 2,
"setId": 1,
"iconIdx": 11
"setId": 4,
"iconIdx": 7
},
{
"icon": {
......@@ -286,8 +238,8 @@
"code": 58884
},
"setIdx": 2,
"setId": 1,
"iconIdx": 12
"setId": 4,
"iconIdx": 8
},
{
"icon": {
......@@ -310,8 +262,8 @@
"code": 58885
},
"setIdx": 2,
"setId": 1,
"iconIdx": 13
"setId": 4,
"iconIdx": 9
},
{
"icon": {
......@@ -334,8 +286,8 @@
"code": 58886
},
"setIdx": 2,
"setId": 1,
"iconIdx": 14
"setId": 4,
"iconIdx": 10
},
{
"icon": {
......@@ -358,8 +310,8 @@
"code": 58888
},
"setIdx": 2,
"setId": 1,
"iconIdx": 15
"setId": 4,
"iconIdx": 11
},
{
"icon": {
......@@ -382,8 +334,8 @@
"code": 58889
},
"setIdx": 2,
"setId": 1,
"iconIdx": 16
"setId": 4,
"iconIdx": 12
},
{
"icon": {
......@@ -406,8 +358,8 @@
"code": 58890
},
"setIdx": 2,
"setId": 1,
"iconIdx": 17
"setId": 4,
"iconIdx": 13
},
{
"icon": {
......@@ -430,8 +382,8 @@
"code": 58892
},
"setIdx": 2,
"setId": 1,
"iconIdx": 18
"setId": 4,
"iconIdx": 14
},
{
"icon": {
......@@ -454,8 +406,8 @@
"code": 58893
},
"setIdx": 2,
"setId": 1,
"iconIdx": 19
"setId": 4,
"iconIdx": 15
},
{
"icon": {
......@@ -479,8 +431,8 @@
"code": 58894
},
"setIdx": 2,
"setId": 1,
"iconIdx": 20
"setId": 4,
"iconIdx": 16
},
{
"icon": {
......@@ -503,8 +455,8 @@
"code": 58895
},
"setIdx": 2,
"setId": 1,
"iconIdx": 21
"setId": 4,
"iconIdx": 17
},
{
"icon": {
......@@ -527,8 +479,8 @@
"code": 58896
},
"setIdx": 2,
"setId": 1,
"iconIdx": 22
"setId": 4,
"iconIdx": 18
},
{
"icon": {
......@@ -551,8 +503,8 @@
"code": 58897
},
"setIdx": 2,
"setId": 1,
"iconIdx": 23
"setId": 4,
"iconIdx": 19
},
{
"icon": {
......@@ -575,8 +527,8 @@
"code": 58898
},
"setIdx": 2,
"setId": 1,
"iconIdx": 24
"setId": 4,
"iconIdx": 20
},
{
"icon": {
......@@ -599,8 +551,8 @@
"code": 58899
},
"setIdx": 2,
"setId": 1,
"iconIdx": 25
"setId": 4,
"iconIdx": 21
},
{
"icon": {
......@@ -623,8 +575,8 @@
"code": 58900
},
"setIdx": 2,
"setId": 1,
"iconIdx": 26
"setId": 4,
"iconIdx": 22
},
{
"icon": {
......@@ -647,8 +599,8 @@
"name": "insert-comment"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 27
"setId": 4,
"iconIdx": 23
},
{
"icon": {
......@@ -671,8 +623,8 @@
"code": 58901
},
"setIdx": 2,
"setId": 1,
"iconIdx": 28
"setId": 4,
"iconIdx": 24
},
{
"icon": {
......@@ -695,8 +647,32 @@
"code": 58902
},
"setIdx": 2,
"setId": 1,
"iconIdx": 29
"setId": 4,
"iconIdx": 25
},
{
"icon": {
"paths": [
"M298.667 426.667l213.333 213.333 213.333-213.333z"
],
"attrs": [],
"isMulticolor": false,
"tags": [
"arrow-drop-down"
],
"grid": 24
},
"attrs": [],
"properties": {
"id": 673,
"order": 43,
"prevSize": 24,
"name": "arrow-drop-down",
"code": 58905
},
"setIdx": 2,
"setId": 4,
"iconIdx": 26
},
{
"icon": {
......@@ -719,8 +695,8 @@
"code": 58906
},
"setIdx": 2,
"setId": 1,
"iconIdx": 31
"setId": 4,
"iconIdx": 27
},
{
"icon": {
......@@ -743,8 +719,8 @@
"code": 58907
},
"setIdx": 2,
"setId": 1,
"iconIdx": 32
"setId": 4,
"iconIdx": 28
},
{
"icon": {
......@@ -767,8 +743,8 @@
"name": "chevron-left"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 33
"setId": 4,
"iconIdx": 29
},
{
"icon": {
......@@ -784,15 +760,15 @@
},
"attrs": [],
"properties": {
"order": 61,
"order": 33,
"id": 750,
"prevSize": 24,
"code": 58904,
"name": "chevron-right"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 34
"setId": 4,
"iconIdx": 30
},
{
"icon": {
......@@ -815,8 +791,56 @@
"code": 58908
},
"setIdx": 2,
"setId": 1,
"iconIdx": 35
"setId": 4,
"iconIdx": 31
},
{
"icon": {
"paths": [
"M512 341.333l-256 256 60.373 60.373 195.627-195.627 195.627 195.627 60.373-60.373z"
],
"attrs": [],
"isMulticolor": false,
"tags": [
"expand-less"
],
"grid": 24
},
"attrs": [],
"properties": {
"id": 682,
"order": 35,
"prevSize": 24,
"name": "expand-less",
"code": 58909
},
"setIdx": 2,
"setId": 4,
"iconIdx": 32
},
{
"icon": {
"paths": [
"M707.627 366.293l-195.627 195.627-195.627-195.627-60.373 60.373 256 256 256-256z"
],
"attrs": [],
"isMulticolor": false,
"tags": [
"expand-more"
],
"grid": 24
},
"attrs": [],
"properties": {
"id": 683,
"order": 36,
"name": "expand-more",
"prevSize": 24,
"code": 58910
},
"setIdx": 2,
"setId": 4,
"iconIdx": 33
},
{
"icon": {
......@@ -839,8 +863,8 @@
"code": 58914
},
"setIdx": 2,
"setId": 1,
"iconIdx": 38
"setId": 4,
"iconIdx": 34
},
{
"icon": {
......@@ -863,8 +887,8 @@
"code": 58915
},
"setIdx": 2,
"setId": 1,
"iconIdx": 39
"setId": 4,
"iconIdx": 35
},
{
"icon": {
......@@ -890,9 +914,9 @@
"code": 58922,
"name": "mail"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 40
"setIdx": 4,
"setId": 2,
"iconIdx": 0
},
{
"icon": {
......@@ -918,9 +942,9 @@
"ligatures": "google-plus, brand2",
"name": "google-plus"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 41
"setIdx": 1,
"setId": 5,
"iconIdx": 392
},
{
"icon": {
......@@ -946,9 +970,9 @@
"ligatures": "facebook2, brand7",
"name": "facebook"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 42
"setIdx": 1,
"setId": 5,
"iconIdx": 397
},
{
"icon": {
......@@ -975,9 +999,9 @@
"ligatures": "twitter, brand11",
"name": "twitter"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 43
"setIdx": 1,
"setId": 5,
"iconIdx": 401
},
{
"icon": {
......@@ -1007,9 +1031,9 @@
"code": 58911,
"name": "cc-by"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 44
"setIdx": 3,
"setId": 3,
"iconIdx": 0
},
{
"icon": {
......@@ -1039,9 +1063,9 @@
"code": 58912,
"name": "cc-logo"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 45
"setIdx": 3,
"setId": 3,
"iconIdx": 1
},
{
"icon": {
......@@ -1078,9 +1102,9 @@
"code": 58913,
"name": "cc-zero"
},
"setIdx": 2,
"setId": 1,
"iconIdx": 46
"setIdx": 3,
"setId": 3,
"iconIdx": 2
},
{
"icon": {
......@@ -1111,9 +1135,9 @@
"name": "markdown",
"code": 58891
},
"setIdx": 2,
"setId": 1,
"iconIdx": 47
"setIdx": 3,
"setId": 3,
"iconIdx": 3
}
],
"height": 1024,
......
This diff is collapsed.
......@@ -35,15 +35,8 @@
<!-- / Editing controls -->
</span>
<span class="annotation-collapsed-replies">
<a class="reply-count small" href=""
ng-click="replyCountClick()"
ng-pluralize count="replyCount"
when="{'0': '', 'one': '1 reply', 'other': '{} replies'}"></a>
</span>
<!-- Timestamp -->
<a class="annotation-timestamp"
<a class="annotation-timestamp small pull-right"
target="_blank"
title="{{vm.annotation.updated | moment:'LLLL'}}"
ng-if="!vm.editing && vm.annotation.updated"
......
......@@ -2,8 +2,8 @@
class="threadexp"
title="{{vm.collapsed && 'Expand' || 'Collapse'}}"
ng-click="vm.toggleCollapsed()">
<span ng-class="{'h-icon-arrow-right': !!vm.collapsed,
'h-icon-arrow-drop-down': !vm.collapsed}"></span>
<span ng-class="{'h-icon-expand-more': !!vm.collapsed,
'h-icon-expand-less': !vm.collapsed}"></span>
</a>
<!-- Annotation -->
......@@ -11,7 +11,7 @@
<p><em>Message not available.</em></p>
</div>
<article class="annotation thread-message {{vm.collapsed && 'collapsed'}}"
<article class="annotation thread-message"
name="annotation"
annotation="vm.container.message"
annotation-embedded="{{isEmbedded}}"
......
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