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