[#1672] don't allow clicking checkboxes on challenge-editing page

This commit is contained in:
Tyler Renelle
2013-11-01 10:20:14 -07:00
parent 907f8792a6
commit 7037e1c8eb
2 changed files with 5 additions and 1 deletions

View File

@@ -35,6 +35,8 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
if (gid == 'habitrpg') $scope.newChallenge.prize = 1;
})
// override score() for tasks listed in challenges-editing pages, so that nothing happens
$scope.score = function(){}
//------------------------------------------------------------
// Challenge

View File

@@ -41,6 +41,7 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
// Habits
span(ng-if='task.type=="habit"')
// score() is overridden in challengesCtrl to do nothing
a.task-action-btn(ng-if='task.up', ng-click='score(task,"up")') +
a.task-action-btn(ng-if='task.down', ng-click='score(task,"down")') -
@@ -52,7 +53,8 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
// Daily & Todos
span.task-checker.action-yesno(ng-if='task.type=="daily" || task.type=="todo"')
input.visuallyhidden.focusable(id='box-{{obj._id}}_{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='changeCheck(task)')
input.visuallyhidden.focusable(ng-if='$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='changeCheck(task)')
input.visuallyhidden.focusable(ng-if='!$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox')
label(for='box-{{obj._id}}_{{task.id}}')
// main content
p.task-text