Commit 9a161af8 authored by Randall Leeds's avatar Randall Leeds

Kill the slide-over detail

Fix #466
parent 0125ec0e
......@@ -297,15 +297,15 @@ blockquote {
&:before {
content: "\23";
font-size: 6em;
top: -.2em;
left: -.15em;
top: -.36em;
left: -.31em;
}
&:after {
content: "\24";
font-size: 5em;
right: -.15em;
bottom: -.1em;
right: -.31em;
bottom: -.27em;
}
}
......@@ -835,7 +835,6 @@ blockquote {
//SUMMARY////////////////////////////////
//This is specific to the summary view.
.summary {
margin-bottom: 1em;
position: relative;
cursor: pointer;
......@@ -848,11 +847,6 @@ blockquote {
@include smallshadow(2px, 1px, .1);
bottom: 0;
}
// Things not shown in the summary view
.magicontrols .show {
display: none;
}
}
//STREAMER////////////////////////////////
......
......@@ -379,25 +379,7 @@ class Viewer
$location, $routeParams, $scope,
annotator
) ->
{plugins, provider} = annotator
listening = false
refresh = =>
return unless $scope.frame.visible
this.refresh $scope, $routeParams, annotator
if listening
if $scope.detail
plugins.Heatmap.unsubscribe 'updated', refresh
listening = false
else
unless $scope.detail
plugins.Heatmap.subscribe 'updated', refresh
listening = true
$scope.showDetail = (annotation) ->
search = $location.search() or {}
search.id = annotation.id
$location.search(search).replace()
{provider, threading} = annotator
$scope.focus = (annotation) ->
if angular.isArray annotation
......@@ -408,29 +390,31 @@ class Viewer
highlights = []
provider.notify method: 'setActiveHighlights', params: highlights
$scope.replies = (annotation) ->
thread = threading.idTable[annotation.id]
(r.message for r in thread.children)
$scope.toggleDetail = ($event) ->
# XXX: Super hacky nonsense here that should probably be handled
# by stopping the propagation or something. Also, the silly traversal
# of scope has got to stop.
$target = angular.element $event.target
if (
$event.target.tagName in ['A', 'BUTTON', 'INPUT', 'TEXTAREA'] or
$target.attr('ng-click') or
$target.attr('role') == 'button'
)
$target.scope()?.$parent?.$$prevSibling?.collapsed = false
@detail = true
else
@detail = !@detail
$scope.sortThread = (thread) ->
if thread?.message?.updated
return new Date(thread.message.updated)
else
return new Date()
$scope.$on '$destroy', ->
if listening then plugins.Heatmap.unsubscribe 'updated', refresh
$scope.$on '$routeUpdate', refresh
refresh()
refresh: ($scope, $routeParams, annotator) =>
if $routeParams.id? and annotator.threading.idTable[$routeParams.id]?
$scope.detail = true
$scope.thread = annotator.threading.getContainer $routeParams.id
$scope.focus $scope.thread.message?
else
$scope.detail = false
$scope.thread = null
$scope.focus []
angular.module('h.controllers', ['bootstrap'])
.controller('AppController', App)
......
annotation = ['$filter', ($filter) ->
annotation = ['$filter', 'annotator', ($filter, annotator) ->
link: (scope, elem, attrs, controller) ->
return unless controller?
......@@ -9,6 +9,10 @@ annotation = ['$filter', ($filter) ->
e.preventDefault()
scope.save()
# Watch for changes
scope.$watch 'model.$modelValue.id', (id) ->
scope.thread = annotator.threading.idTable[id]
# Publish the controller
scope.model = controller
controller: 'AnnotationController'
......
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