Commit 20822425 authored by Randall Leeds's avatar Randall Leeds

Merge pull request #2073 from hypothesis/remove-dead-code

Removed some dead code
parents a5c9417f 35c612e3
......@@ -6,10 +6,6 @@ createAnnotationUI = ->
if Object.keys(selection).length then selection else null
{
TOOL_COMMENT: 'comment'
TOOL_HIGHLIGHT: 'highlight'
tool: 'comment'
visibleHighlights: false
......
......@@ -27,9 +27,6 @@ class AnnotationUISync
toggleAnnotationSelection: (ctx, tags=[]) ->
annotations = getAnnotationsByTags(tags)
annotationUI.xorSelectedAnnotations(annotations)
setTool: (ctx, name) ->
annotationUI.tool = name
bridge.notify(method: 'setTool', params: name)
setVisibleHighlights: (ctx, state) ->
annotationUI.visibleHighlights = Boolean(state)
bridge.notify(method: 'setVisibleHighlights', params: state)
......@@ -48,10 +45,6 @@ class AnnotationUISync
onConnect = (channel, source) ->
# Allow the host to define its own state
unless source is $window.parent
channel.notify
method: 'setTool'
params: annotationUI.tool
channel.notify
method: 'setVisibleHighlights'
params: annotationUI.visibleHighlights
......
......@@ -66,12 +66,8 @@ class AppController
cleanupAnnotations = ->
# Clean up any annotations that need to be unloaded.
for id, container of $scope.threading.idTable when container.message
# Remove annotations not belonging to this user when highlighting.
if annotationUI.tool is 'highlight' and annotation.user != auth.user
$scope.$emit('annotationDeleted', container.message)
drafts.remove annotation
# Remove annotations the user is not authorized to view.
else if not permissions.permits 'read', container.message, auth.user
if not permissions.permits 'read', container.message, auth.user
$scope.$emit('annotationDeleted', container.message)
drafts.remove container.message
......
......@@ -46,7 +46,6 @@ module.exports = class Annotator.Host extends Annotator.Guest
# Guest is designed to respond to events rather than direct method
# calls. If we call set directly the other plugins will never recieve
# these events and the UI will be out of sync.
this.publish('setTool', 'comment')
this.publish('setVisibleHighlights', !!options.showHighlights)
if @plugins.BucketBar?
......
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