Commit 8cf994cd authored by csillag's avatar csillag

Do angular magic differently

This commit changes how we trigger the refreshing
of the markdown previews in the editor.

It has to do with how angular apply / digest cycles
interwene and crash in some cases.

The change was suggested by @RawKStar77 here:

https://github.com/hypothesis/h/pull/2038#discussion_r26867418
parent c927c44a
......@@ -335,8 +335,7 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
# React to the changes to the input
inputEl.bind 'blur change keyup', ->
ctrl.$setViewValue inputEl.val()
scope.$digest()
$timeout -> ctrl.$setViewValue inputEl.val()
# Reset height of output div incase it has been changed.
# Re-render when it becomes uneditable.
......
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