Commit b24cc721 authored by csillag's avatar csillag

Don't open/collapse annotation cards on text selection.

Fixes #788
parent 910d5c6b
...@@ -211,9 +211,16 @@ tabReveal = ['$parse', ($parse) -> ...@@ -211,9 +211,16 @@ tabReveal = ['$parse', ($parse) ->
thread = ['$timeout', ($timeout) -> thread = ['$timeout', ($timeout) ->
link: (scope, elem, attr, ctrl) -> link: (scope, elem, attr, ctrl) ->
childrenEditing = {} childrenEditing = {}
sel = window.getSelection()
scope.toggleCollapsedDown = (event) ->
event.stopPropagation()
scope.oldSelection = sel.toString()
scope.toggleCollapsed = (event) -> scope.toggleCollapsed = (event) ->
event.stopPropagation() event.stopPropagation()
# If we have selected something, then don't bother
return unless sel.toString() is scope.oldSelection
$timeout -> $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
......
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