Skip to content

Commit 560a567

Browse files
committed
Merge pull request seiyria#59 from hmillet/master
Add an alternative for tooltip conflict
2 parents b7bc8ef + 10974f0 commit 560a567

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,17 @@ Sample Usage
1616
<!-- ..or an attribute -->
1717
<span slider ng-model="sliders.secondSliderValue" min="minTest"></span>
1818
```
19+
20+
Troubleshooting
21+
============
22+
#### Tooltips
23+
If you Want to hide the tooltip on your slider (or define a value for the bootstrap-slider `data-slider-tooltip` options, such as "show", "hide" or "always"), you should use the `tooltip` attribute, like this :
24+
```html
25+
<!-- it can be used as an element -->
26+
<slider ng-model="sliders.sliderValue" min="testOptions.min" step="testOptions.step" max="testOptions.max" value="testOptions.value" tooltip="hide"></slider>
27+
```
28+
But, if the `tooltip` attribute is in conflict with another angular directive, you can use the alternative `slider-tooltip` attribute :
29+
```html
30+
<!-- it can be used as an element -->
31+
<slider ng-model="sliders.sliderValue" min="testOptions.min" step="testOptions.step" max="testOptions.max" value="testOptions.value" slider-tooltip="hide"></slider>
32+
```

slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ angular.module('ui.bootstrap-slider', [])
4646
setOption('orientation', attrs.orientation, 'horizontal');
4747
setOption('selection', attrs.selection, 'before');
4848
setOption('handle', attrs.handle, 'round');
49-
setOption('tooltip', attrs.tooltip, 'show');
49+
setOption('tooltip', attrs.sliderTooltip || attrs.tooltip, 'show');
5050
setOption('tooltipseparator', attrs.tooltipseparator, ':');
5151

5252
setFloatOption('min', $scope.min, 0);

0 commit comments

Comments
 (0)