|
1 | 1 | /*! angularjs-slider - v2.3.0 - |
2 | 2 | (c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervieu.me>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com> - |
3 | 3 | https://github.com/angular-slider/angularjs-slider - |
4 | | - 2015-12-29 */ |
| 4 | + 2015-12-30 */ |
5 | 5 | /*jslint unparam: true */ |
6 | 6 | /*global angular: false, console: false, define, module */ |
7 | 7 | (function(root, factory) { |
|
37 | 37 | draggableRange: false, |
38 | 38 | draggableRangeOnly: false, |
39 | 39 | showSelectionBar: false, |
| 40 | + showSelectionBarEnd: false, |
40 | 41 | hideLimitLabels: false, |
41 | 42 | readOnly: false, |
42 | 43 | disabled: false, |
|
406 | 407 | this.options.showTicks = this.options.showTicks || this.options.showTicksValues; |
407 | 408 | this.scope.showTicks = this.options.showTicks; //scope is used in the template |
408 | 409 |
|
| 410 | + this.options.showSelectionBar = this.options.showSelectionBar || this.options.showSelectionBarEnd; |
| 411 | + |
409 | 412 | if (this.options.stepsArray) { |
410 | 413 | this.options.floor = 0; |
411 | 414 | this.options.ceil = this.options.stepsArray.length - 1; |
|
925 | 928 | * @returns {undefined} |
926 | 929 | */ |
927 | 930 | updateSelectionBar: function() { |
928 | | - this.setDimension(this.selBar, Math.abs(this.maxH.rzsp - this.minH.rzsp) + this.handleHalfDim); |
929 | | - this.setPosition(this.selBar, this.range ? this.minH.rzsp + this.handleHalfDim : 0); |
| 931 | + var position = 0, |
| 932 | + dimension = 0; |
| 933 | + if (this.range || !this.options.showSelectionBarEnd) { |
| 934 | + dimension = Math.abs(this.maxH.rzsp - this.minH.rzsp) + this.handleHalfDim |
| 935 | + position = this.range ? this.minH.rzsp + this.handleHalfDim : 0; |
| 936 | + } else { |
| 937 | + dimension = Math.abs(this.maxPos - this.minH.rzsp) + this.handleHalfDim |
| 938 | + position = this.minH.rzsp + this.handleHalfDim; |
| 939 | + } |
| 940 | + this.setDimension(this.selBar, dimension); |
| 941 | + this.setPosition(this.selBar, position); |
930 | 942 | if (this.options.getSelectionBarColor) { |
931 | 943 | var color = this.getSelectionBarColor(); |
932 | 944 | this.scope.barStyle = { |
|
0 commit comments