Skip to content

Commit

Permalink
bug fix: unable to deselect an item
Browse files Browse the repository at this point in the history
  • Loading branch information
isteven committed Jul 15, 2014
1 parent a4527a4 commit ba6d164
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions angular-multi-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,17 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', '$
$scope.inputModel[ i ][ $scope.tickProperty ] = false;
}

$scope.toggleCheckboxes( e );
// then set the clicked item to true
$scope.filteredModel[ index ][ $scope.tickProperty ] = true;

$scope.toggleCheckboxes( e );
}

// Multiple
else {
$scope.filteredModel[ index ][ $scope.tickProperty ] = !$scope.filteredModel[ index ][ $scope.tickProperty ];
}

// then set the clicked item to true
$scope.filteredModel[ index ][ $scope.tickProperty ] = true;

// we refresh input model as well
inputModelIndex = $scope.filteredModel[ index ][ $scope.indexProperty ];
$scope.inputModel[ inputModelIndex ][ $scope.tickProperty ] = $scope.filteredModel[ index ][ $scope.tickProperty ];
Expand Down

0 comments on commit ba6d164

Please sign in to comment.