Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit d53fdb6

Browse files
author
Austin McDaniel
committed
#319 fix for lock selections
1 parent b044b41 commit d53fdb6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/select.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@
366366
e.stopPropagation();
367367
};
368368

369+
ctrl.isLocked = function(index){
370+
return ctrl.selected[index] && ctrl.selected[index].locked;
371+
};
372+
369373
// Remove item from multiple select
370374
ctrl.removeChoice = function(index){
371375
var removedChoice = ctrl.selected[index];

src/select2/match-multiple.tpl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
-->
66
<span class="ui-select-match">
77
<li class="ui-select-match-item select2-search-choice" ng-repeat="$item in $select.selected"
8-
ng-class="{'select2-search-choice-focus':$select.activeMatchIndex === $index}">
8+
ng-class="{'select2-search-choice-focus':$select.activeMatchIndex === $index, 'select2-locked':$select.isLocked($index)}">
99
<span uis-transclude-append></span>
10-
<a href="javascript:;" class="ui-select-match-close select2-search-choice-close" ng-click="$select.removeChoice($index)" tabindex="-1"></a>
10+
<a href="javascript:;" ng-if="!$select.isLocked($index)" class="ui-select-match-close select2-search-choice-close" ng-click="$select.removeChoice($index)" tabindex="-1"></a>
1111
</li>
1212
</span>

0 commit comments

Comments
 (0)