From b075acdef27b4b873e95a72fd0d18d38b41a5236 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 27 Mar 2015 11:17:09 +0100 Subject: [PATCH] [backport] fix reset US edit lightbox points --- app/coffee/modules/common/estimation.coffee | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/coffee/modules/common/estimation.coffee b/app/coffee/modules/common/estimation.coffee index 3ca34f5f..09b11e5e 100644 --- a/app/coffee/modules/common/estimation.coffee +++ b/app/coffee/modules/common/estimation.coffee @@ -40,12 +40,14 @@ LbUsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $confirm, $ link = ($scope, $el, $attrs, $model) -> $scope.$watch $attrs.ngModel, (us) -> + console.log "watch" if us estimationProcess = $tgEstimationsService.create($el, us, $scope.project) estimationProcess.onSelectedPointForRole = (roleId, pointId) -> $scope.$apply -> $model.$setViewValue(us) + estimationProcess.render = () -> ctx = { totalPoints: @calculateTotalPoints() @@ -224,16 +226,12 @@ EstimationsService = ($template, $qqueue, $repo, $confirm, $q) -> @$el.find(".pop-points-open").show() create = ($el, us, project) -> - estimationProcess = $el.data("estimationProcess") + $el.unbind("click") - if !estimationProcess - estimationProcess = new EstimationProcess($el, us, project) - $el.data("estimationProcess", estimationProcess) + estimationProcess = new EstimationProcess($el, us, project) if estimationProcess.isEditable estimationProcess.bindClickEvents() - else - $el.unbind("click") return estimationProcess