Commit dd64fafe authored by Randall Leeds's avatar Randall Leeds

Remove some outdated timeouts on thread collapsing

I believe this is no longer necessary since we started using
`event.preventDefault` more consistently in annotation actions.

That's good, because this timeout stuff was brittle.
parent 23d8858f
......@@ -208,7 +208,7 @@ tabReveal = ['$parse', ($parse) ->
]
thread = ['$timeout', ($timeout) ->
thread = ->
link: (scope, elem, attr, ctrl) ->
childrenEditing = {}
sel = window.getSelection()
......@@ -221,11 +221,9 @@ thread = ['$timeout', ($timeout) ->
event.stopPropagation()
# If we have selected something, then don't bother
return unless sel.toString() is scope.oldSelection
$timeout ->
return unless Object.keys(childrenEditing).length is 0
scope.collapsed = !scope.collapsed
scope.openDetails scope.annotation unless scope.collapsed
, 10
return unless Object.keys(childrenEditing).length is 0
scope.collapsed = !scope.collapsed
scope.openDetails scope.annotation unless scope.collapsed
scope.$on 'toggleEditing', (event) ->
{$id, editing} = event.targetScope
......@@ -233,12 +231,11 @@ thread = ['$timeout', ($timeout) ->
scope.collapsed = false
unless childrenEditing[$id]
event.targetScope.$on '$destroy', ->
$timeout (-> delete childrenEditing[$id]), 100
delete childrenEditing[$id]
childrenEditing[$id] = true
else
$timeout (-> delete childrenEditing[$id]), 100
delete childrenEditing[$id]
restrict: 'C'
]
userPicker = ->
......
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