Commit 81d21daa authored by RawKStar77's avatar RawKStar77

Take renderMath() and MathJaxFallback off of scope

parent fd0ba1dd
...@@ -251,8 +251,8 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc ...@@ -251,8 +251,8 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
input.style.height = output.style.height input.style.height = output.style.height
$timeout -> inputEl.focus() $timeout -> inputEl.focus()
scope.MathJaxFallback = false MathJaxFallback = false
scope.renderMath = (textToCheck) -> renderMath = (textToCheck) ->
# Parses text for math as denoted by '$$' # Parses text for math as denoted by '$$'
i = 0 i = 0
startMath = null startMath = null
...@@ -293,7 +293,7 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc ...@@ -293,7 +293,7 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
) )
startMath = null startMath = null
endMath = null endMath = null
scope.renderMath(textToCheck) renderMath(textToCheck)
return textToCheck return textToCheck
# Re-render the markdown when the view needs updating. # Re-render the markdown when the view needs updating.
...@@ -302,9 +302,9 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc ...@@ -302,9 +302,9 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
inputEl.val (ctrl.$viewValue or '') inputEl.val (ctrl.$viewValue or '')
value = ctrl.$viewValue or '' value = ctrl.$viewValue or ''
markdown = $sanitize $filter('converter') value markdown = $sanitize $filter('converter') value
rendered = scope.renderMath markdown rendered = renderMath markdown
scope.rendered = $sce.trustAsHtml rendered scope.rendered = $sce.trustAsHtml rendered
if scope.MathJaxFallback if MathJaxFallback
MathJax?.Hub.Queue(["Typeset",MathJax.Hub]) MathJax?.Hub.Queue(["Typeset",MathJax.Hub])
# React to the changes to the input # React to the changes to the input
......
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