This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +30
-10
lines changed Expand file tree Collapse file tree 4 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 102
102
</ div >
103
103
</ div >
104
104
105
+ < div class ="form-group ">
106
+ < label class ="col-sm-3 control-label "> Disabled</ label >
107
+ < div class ="col-sm-6 ">
108
+
109
+ < ui-select ng-model ="person.selected " theme ="selectize " class ="form-control " ng-disabled ="true ">
110
+ < match placeholder ="Select or search a person in the list... "> {{$select.selected.name}}</ match >
111
+ < choices repeat ="item in people | filter: $select.search ">
112
+ < div ng-bind-html ="trustAsHtml((item.name | highlight: $select.search)) "> </ div >
113
+ < small ng-bind-html ="trustAsHtml((item.email | highlight: $select.search)) "> </ small >
114
+ </ choices >
115
+ </ ui-select >
116
+
117
+ </ div >
118
+ </ div >
119
+
105
120
</ fieldset >
106
121
</ form >
107
122
Original file line number Diff line number Diff line change @@ -44,11 +44,13 @@ angular.module('ui.select', [])
44
44
ctrl . open = false ;
45
45
46
46
ctrl . activate = function ( ) {
47
- ctrl . open = true ;
48
- // Give it time to appear before focus
49
- setTimeout ( function ( ) {
50
- ctrl . input [ 0 ] . focus ( ) ;
51
- } ) ;
47
+ if ( ctrl . disabled === false ) {
48
+ ctrl . open = true ;
49
+ // Give it time to appear before focus
50
+ setTimeout ( function ( ) {
51
+ ctrl . input [ 0 ] . focus ( ) ;
52
+ } ) ;
53
+ }
52
54
} ;
53
55
54
56
ctrl . select = function ( item ) {
Original file line number Diff line number Diff line change 1
1
< div class ="select2 select2-container "
2
- ng-class ="{'select2-container-active select2-dropdown-open': $select.open && !$select.disabled ,
2
+ ng-class ="{'select2-container-active select2-dropdown-open': $select.open,
3
3
'select2-container-disabled': $select.disabled} ">
4
4
< div class ="ui-select-match "> </ div >
5
- < div ng-class ="{'select2-display-none': !$select.open || $select.disabled } "
5
+ < div ng-class ="{'select2-display-none': !$select.open} "
6
6
class ="select2-drop select2-with-searchbox select2-drop-active ">
7
7
< div class ="select2-search ">
8
8
< input type ="text "
Original file line number Diff line number Diff line change 1
1
< div class ="selectize-control single ">
2
2
< div class ="selectize-input "
3
- ng-class ="{'focus': $select.open} "
3
+ ng-class ="{'focus': $select.open, 'disabled': $select.disabled } "
4
4
ng-click ="$select.activate() ">
5
5
< div class ="ui-select-match "> </ div >
6
- < input type ="text " class ="ui-select-search " autocomplete ="off " tabindex ="" placeholder ="{{$select.placeholder}} "
6
+ < input type ="text " autocomplete ="off " tabindex =""
7
+ class ="ui-select-search "
8
+ placeholder ="{{$select.placeholder}} "
7
9
ng-model ="$select.search "
8
- ng-hide ="$select.selected && !$select.open ">
10
+ ng-hide ="$select.selected && !$select.open "
11
+ ng-disabled ="$select.disabled ">
9
12
</ div >
10
13
< div class ="ui-select-choices "> </ div >
11
14
</ div >
You can’t perform that action at this time.
0 commit comments