Commit a15c2d73 by Miles Steele

change to .text() extraction of template, fix SafeWaiter error handling

parent e0760d95
...@@ -14,7 +14,7 @@ class ProfileDistributionWidget ...@@ -14,7 +14,7 @@ class ProfileDistributionWidget
title: @title title: @title
feature: @feature feature: @feature
endpoint: @endpoint endpoint: @endpoint
template_html = $("#profile-distribution-widget-template").html() template_html = $("#profile-distribution-widget-template").text()
@$container.html Mustache.render template_html, template_params @$container.html Mustache.render template_html, template_params
reset_display: -> reset_display: ->
...@@ -93,7 +93,7 @@ class ProfileDistributionWidget ...@@ -93,7 +93,7 @@ class ProfileDistributionWidget
class GradeDistributionDisplay class GradeDistributionDisplay
constructor: ({@$container, @endpoint}) -> constructor: ({@$container, @endpoint}) ->
template_params = {} template_params = {}
template_html = $('#grade-distributions-widget-template').html() template_html = $('#grade-distributions-widget-template').text()
@$container.html Mustache.render template_html, template_params @$container.html Mustache.render template_html, template_params
@$problem_selector = @$container.find '.problem-selector' @$problem_selector = @$container.find '.problem-selector'
......
...@@ -61,10 +61,8 @@ class SafeWaiter ...@@ -61,10 +61,8 @@ class SafeWaiter
=> =>
@waitFor_handlers = @waitFor_handlers.filter (g) -> g isnt f @waitFor_handlers = @waitFor_handlers.filter (g) -> g isnt f
if @waitFor_handlers.length is 0 if @waitFor_handlers.length is 0
plantTimeout 0, => @fired = true
@fired = true @after_handlers.map (cb) -> plantTimeout 0, cb
for cb in @after_handlers
cb()
f.apply this, arguments f.apply this, arguments
......
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