From: Marcin Koziej Date: Wed, 13 Feb 2013 13:30:52 +0000 (+0100) Subject: js fixes X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/ca7ebe153aa3986421f5c161f08c674b4eaaf141 js fixes --- diff --git a/catalogue/static/catalogue/js/edumed.js b/catalogue/static/catalogue/js/edumed.js index 1886b38..a99377d 100644 --- a/catalogue/static/catalogue/js/edumed.js +++ b/catalogue/static/catalogue/js/edumed.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.3.3 +// Generated by CoffeeScript 1.4.0 (function() { var $, Binding, EduModule, Exercise, Luki, PrawdaFalsz, Przyporzadkuj, Uporzadkuj, Wybor, Zastap, exercise, __hasProp = {}.hasOwnProperty, @@ -557,7 +557,7 @@ m = draggables[_j]; $pr = $(".predicate [data-predicate=" + m + "]", question); $ph = $pr.find(".placeholder:visible"); - _results1.push(this.draggable_move($(qp), $ph, this.multiple)); + _results1.push(this.draggable_move($(qp), $ph.eq(0), this.multiple)); } return _results1; }).call(this)); @@ -574,22 +574,23 @@ __extends(PrawdaFalsz, _super); function PrawdaFalsz(element) { - var qp, _i, _len, _ref; + var qp, _i, _len, _ref, + _this = this; PrawdaFalsz.__super__.constructor.call(this, element); _ref = $(".question-piece", this.element); for (_i = 0, _len = _ref.length; _i < _len; _i++) { qp = _ref[_i]; $(".true", qp).click(function(ev) { ev.preventDefault(); - this.retry(); - $(this).closest(".question-piece").data("value", "true"); - return $(this).addClass('chosen').siblings('a').removeClass('chosen'); + _this.retry(); + $(ev.target).closest(".question-piece").data("value", "true"); + return $(ev.target).addClass('chosen').siblings('a').removeClass('chosen'); }); $(".false", qp).click(function(ev) { ev.preventDefault(); - this.retry(); - $(this).closest(".question-piece").data("value", "false"); - return $(this).addClass('chosen').siblings('a').removeClass('chosen'); + _this.retry(); + $(ev.target).closest(".question-piece").data("value", "false"); + return $(ev.target).addClass('chosen').siblings('a').removeClass('chosen'); }); } }