|
1 | 1 | /*! angularjs-slider - v6.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 | | - 2017-08-07 */ |
| 4 | + 2017-08-11 */ |
5 | 5 | /*jslint unparam: true */ |
6 | 6 | /*global angular: false, console: false, define, module */ |
7 | 7 | (function(root, factory) { |
|
50 | 50 | showSelectionBar: false, |
51 | 51 | showSelectionBarEnd: false, |
52 | 52 | showSelectionBarFromValue: null, |
| 53 | + showOuterSelectionBars: false, |
53 | 54 | hidePointerLabels: false, |
54 | 55 | hideLimitLabels: false, |
55 | 56 | autoHideLimitLabels: true, |
|
658 | 659 |
|
659 | 660 | switch (index) { |
660 | 661 | case 0: |
661 | | - this.fullBar = jElem; |
| 662 | + this.leftOutSelBar = jElem; |
662 | 663 | break; |
663 | 664 | case 1: |
664 | | - this.selBar = jElem; |
| 665 | + this.rightOutSelBar = jElem; |
665 | 666 | break; |
666 | 667 | case 2: |
667 | | - this.minH = jElem; |
| 668 | + this.fullBar = jElem; |
668 | 669 | break; |
669 | 670 | case 3: |
670 | | - this.maxH = jElem; |
| 671 | + this.selBar = jElem; |
671 | 672 | break; |
672 | 673 | case 4: |
673 | | - this.flrLab = jElem; |
| 674 | + this.minH = jElem; |
674 | 675 | break; |
675 | 676 | case 5: |
676 | | - this.ceilLab = jElem; |
| 677 | + this.maxH = jElem; |
677 | 678 | break; |
678 | 679 | case 6: |
679 | | - this.minLab = jElem; |
| 680 | + this.flrLab = jElem; |
680 | 681 | break; |
681 | 682 | case 7: |
682 | | - this.maxLab = jElem; |
| 683 | + this.ceilLab = jElem; |
683 | 684 | break; |
684 | 685 | case 8: |
685 | | - this.cmbLab = jElem; |
| 686 | + this.minLab = jElem; |
686 | 687 | break; |
687 | 688 | case 9: |
| 689 | + this.maxLab = jElem; |
| 690 | + break; |
| 691 | + case 10: |
| 692 | + this.cmbLab = jElem; |
| 693 | + break; |
| 694 | + case 11: |
688 | 695 | this.ticks = jElem; |
689 | 696 | break; |
690 | 697 | } |
|
721 | 728 | this.alwaysHide(this.maxLab, hideLabelsForTicks || !this.range || this.options.hidePointerLabels); |
722 | 729 | this.alwaysHide(this.cmbLab, hideLabelsForTicks || !this.range || this.options.hidePointerLabels); |
723 | 730 | this.alwaysHide(this.selBar, !this.range && !this.options.showSelectionBar); |
| 731 | + this.alwaysHide(this.leftOutSelBar, !this.range || !this.options.showOuterSelectionBars); |
| 732 | + this.alwaysHide(this.rightOutSelBar, !this.range || !this.options.showOuterSelectionBars); |
| 733 | + |
| 734 | + if ( this.range && this.options.showOuterSelectionBars ) { |
| 735 | + this.fullBar.addClass('rz-transparent'); |
| 736 | + } |
724 | 737 |
|
725 | 738 | if (this.options.vertical) |
726 | 739 | this.sliderElem.addClass('rz-vertical'); |
|
1281 | 1294 | } |
1282 | 1295 | this.setDimension(this.selBar, dimension); |
1283 | 1296 | this.setPosition(this.selBar, position); |
| 1297 | + if (this.range && this.options.showOuterSelectionBars) { |
| 1298 | + if (this.options.rightToLeft) { |
| 1299 | + this.setDimension(this.rightOutSelBar, position); |
| 1300 | + this.setPosition(this.rightOutSelBar, 0); |
| 1301 | + this.setDimension(this.leftOutSelBar, this.getDimension(this.fullBar) - (position + dimension)); |
| 1302 | + this.setPosition(this.leftOutSelBar, position + dimension); |
| 1303 | + } else { |
| 1304 | + this.setDimension(this.leftOutSelBar, position); |
| 1305 | + this.setPosition(this.leftOutSelBar, 0); |
| 1306 | + this.setDimension(this.rightOutSelBar, this.getDimension(this.fullBar) - (position + dimension)); |
| 1307 | + this.setPosition(this.rightOutSelBar, position + dimension); |
| 1308 | + } |
| 1309 | + } |
1284 | 1310 | if (this.options.getSelectionBarColor) { |
1285 | 1311 | var color = this.getSelectionBarColor(); |
1286 | 1312 | this.scope.barStyle = { |
|
2397 | 2423 | 'use strict'; |
2398 | 2424 |
|
2399 | 2425 | $templateCache.put('rzSliderTpl.html', |
2400 | | - "<div class=rzslider><span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=\"rz-bar rz-selection\" ng-style=barStyle></span></span> <span class=\"rz-pointer rz-pointer-min\" ng-style=minPointerStyle></span> <span class=\"rz-pointer rz-pointer-max\" ng-style=maxPointerStyle></span> <span class=\"rz-bubble rz-limit rz-floor\"></span> <span class=\"rz-bubble rz-limit rz-ceil\"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat=\"t in ticks track by $index\" class=rz-tick ng-class=\"{'rz-selected': t.selected}\" ng-style=t.style ng-attr-uib-tooltip=\"{{ t.tooltip }}\" ng-attr-tooltip-placement={{t.tooltipPlacement}} ng-attr-tooltip-append-to-body=\"{{ t.tooltip ? true : undefined}}\"><span ng-if=\"t.value != null\" class=rz-tick-value ng-attr-uib-tooltip=\"{{ t.valueTooltip }}\" ng-attr-tooltip-placement={{t.valueTooltipPlacement}}>{{ t.value }}</span> <span ng-if=\"t.legend != null\" class=rz-tick-legend>{{ t.legend }}</span></li></ul></div>" |
| 2426 | + "<div class=rzslider><span class=\"rz-bar-wrapper rz-left-out-selection\"><span class=rz-bar></span></span> <span class=\"rz-bar-wrapper rz-right-out-selection\"><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=\"rz-bar rz-selection\" ng-style=barStyle></span></span> <span class=\"rz-pointer rz-pointer-min\" ng-style=minPointerStyle></span> <span class=\"rz-pointer rz-pointer-max\" ng-style=maxPointerStyle></span> <span class=\"rz-bubble rz-limit rz-floor\"></span> <span class=\"rz-bubble rz-limit rz-ceil\"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat=\"t in ticks track by $index\" class=rz-tick ng-class=\"{'rz-selected': t.selected}\" ng-style=t.style ng-attr-uib-tooltip=\"{{ t.tooltip }}\" ng-attr-tooltip-placement={{t.tooltipPlacement}} ng-attr-tooltip-append-to-body=\"{{ t.tooltip ? true : undefined}}\"><span ng-if=\"t.value != null\" class=rz-tick-value ng-attr-uib-tooltip=\"{{ t.valueTooltip }}\" ng-attr-tooltip-placement={{t.valueTooltipPlacement}}>{{ t.value }}</span> <span ng-if=\"t.legend != null\" class=rz-tick-legend>{{ t.legend }}</span></li></ul></div>" |
2401 | 2427 | ); |
2402 | 2428 |
|
2403 | 2429 | }]); |
|
0 commit comments