File tree 3 files changed +25
-1
lines changed
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 14
14
< li ng-repeat ="t in ticks track by $index " class ="rz-tick "
15
15
ng-class ="{'rz-selected': t.selected} " ng-style ="t.style "
16
16
ng-attr-uib-tooltip ="{{ t.tooltip }} " ng-attr-tooltip-placement ="{{t.tooltipPlacement}} "
17
- ng-attr-tooltip-append-to-body ="{{ t.tooltip ? true : undefined}} ">
17
+ ng-attr-tooltip-append-to-body ="{{ t.tooltip ? true : undefined}} "
18
+ ng-disabled ="t.disabled ">
18
19
< span ng-if ="t.value != null " class ="rz-tick-value "
19
20
ng-attr-uib-tooltip ="{{ t.valueTooltip }} "
20
21
ng-attr-tooltip-placement ="{{t.valueTooltipPlacement}} "> {{ t.value }}</ span >
Original file line number Diff line number Diff line change 47
47
id : null ,
48
48
translate : null ,
49
49
getLegend : null ,
50
+ getDisabled : null ,
50
51
stepsArray : null ,
51
52
bindIndexForStepsArray : false ,
52
53
draggableRange : false ,
588
589
} ;
589
590
590
591
this . getLegend = this . options . getLegend ;
592
+ this . getDisabled = this . options . getDisabled ;
591
593
}
592
594
593
595
if ( this . options . vertical ) {
621
623
return step . legend ;
622
624
return null ;
623
625
} ;
626
+
627
+ this . getDisabled = function ( index ) {
628
+ var step = this . options . stepsArray [ index ] ;
629
+ if ( angular . isObject ( step ) )
630
+ return step . disabled ;
631
+ return null ;
632
+ } ;
624
633
} ,
625
634
626
635
/**
1024
1033
if ( legend )
1025
1034
tick . legend = legend ;
1026
1035
}
1036
+ if ( self . getDisabled )
1037
+ tick . disabled = self . getDisabled ( value , self . options . id ) ;
1027
1038
return tick ;
1028
1039
} ) ;
1029
1040
} ,
2141
2152
* @param {number } newValue new model value
2142
2153
*/
2143
2154
positionTrackingHandle : function ( newValue ) {
2155
+ if ( this . scope . ticks [ newValue ] . disabled )
2156
+ return false ;
2144
2157
var valueChanged = false ;
2145
2158
newValue = this . applyMinMaxLimit ( newValue ) ;
2146
2159
if ( this . range ) {
Original file line number Diff line number Diff line change 160
160
& .rz-selected {
161
161
background : @selectedTicksColor ;
162
162
}
163
+ & [disabled ] {
164
+ cursor : not-allowed ;
165
+ opacity : 0.6 ;
166
+ .rz-tick-value ,
167
+ .rz-tick-legend ,
168
+ * {
169
+ cursor : not-allowed ;
170
+ opacity : 0.6 ;
171
+ }
172
+ }
163
173
}
164
174
165
175
.rz-tick-value {
You can’t perform that action at this time.
0 commit comments