Commit 8dcfd66b authored by Randall Leeds's avatar Randall Leeds

Merge pull request #591 from hypothesis/user-stream-improvements-4

Stream improvements 4
parents adf90838 9436734c
......@@ -915,6 +915,14 @@ blockquote {
margin-bottom: .75em;
}
.no-overflow {
overflow: hidden;
}
.strech {
width: 100%;
white-space: nowrap;
}
.filter-body {
overflow: visible;
......@@ -937,6 +945,13 @@ blockquote {
left: 0px;
}
.card-grid {
.full-quote {
margin: 0;
padding-left: 2em;
padding-right: 1.75em;
}
}
@mixin sidebar_animation {
-webkit-transition: 1s linear all;
-moz-transition: 1s linear all;
......
get_quote = (annotation) ->
if annotation.quote? then return annotation.quote
if not 'target' in annotation then return ''
quote = '(Reply annotation)'
for target in annotation['target']
for selector in target['selector']
if selector['type'] is 'TextQuoteSelector'
quote = selector['exact'] + ' '
quote
class Stream
......@@ -27,7 +28,7 @@ class Stream
$scope.filter =
streamfilter
.setPastDataHits(100)
.setPastDataHits(150)
.setMatchPolicyIncludeAny()
.setClausesParse(filterClause)
.getFilter()
......@@ -36,8 +37,29 @@ class Stream
for annotation in data
annotation.action = action
annotation.quote = get_quote annotation
annotation._share_link = window.location.protocol +
'//' + window.location.hostname + ':' + window.location.port + "/a/" + annotation.id
annotation._anim = 'fade'
$scope.annotations.splice 0,0,annotation
switch action
when 'create', 'past'
unless annotation in $scope.annotations
$scope.annotations.unshift annotation
when 'update'
index = 0
for ann in $scope.annotations
if ann.id is annotation.id
# Remove the original
$scope.annotations.splice index,1
# Put back the edited
$scope.annotations.unshift annotation
break
index +=1
when 'delete'
for ann in $scope.annotations
if ann.id is annotation.id
$scope.annotations.splice index,1
break
index +=1
$scope.open = =>
$scope.sock = new SockJS(@path)
......
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