From a15c2d7381cae1fb116d94a6df9fbb603f1ad500 Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Tue, 6 Aug 2013 10:52:22 -0400 Subject: [PATCH] change to .text() extraction of template, fix SafeWaiter error handling --- lms/static/coffee/src/instructor_dashboard/analytics.coffee | 4 ++-- .../src/instructor_dashboard/instructor_dashboard.coffee | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lms/static/coffee/src/instructor_dashboard/analytics.coffee b/lms/static/coffee/src/instructor_dashboard/analytics.coffee index 4656ea528a..cda4c2c84e 100644 --- a/lms/static/coffee/src/instructor_dashboard/analytics.coffee +++ b/lms/static/coffee/src/instructor_dashboard/analytics.coffee @@ -14,7 +14,7 @@ class ProfileDistributionWidget title: @title feature: @feature endpoint: @endpoint - template_html = $("#profile-distribution-widget-template").html() + template_html = $("#profile-distribution-widget-template").text() @$container.html Mustache.render template_html, template_params reset_display: -> @@ -93,7 +93,7 @@ class ProfileDistributionWidget class GradeDistributionDisplay constructor: ({@$container, @endpoint}) -> template_params = {} - template_html = $('#grade-distributions-widget-template').html() + template_html = $('#grade-distributions-widget-template').text() @$container.html Mustache.render template_html, template_params @$problem_selector = @$container.find '.problem-selector' diff --git a/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee b/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee index 5ac99b69b6..a7c803f8ac 100644 --- a/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee +++ b/lms/static/coffee/src/instructor_dashboard/instructor_dashboard.coffee @@ -61,10 +61,8 @@ class SafeWaiter => @waitFor_handlers = @waitFor_handlers.filter (g) -> g isnt f if @waitFor_handlers.length is 0 - plantTimeout 0, => - @fired = true - for cb in @after_handlers - cb() + @fired = true + @after_handlers.map (cb) -> plantTimeout 0, cb f.apply this, arguments