Skip to content

Commit 1542cfb

Browse files
committed
Merge pull request #276 from Liam-Ryan/pr/rtl
feat(RzSlider): Add RTL support
2 parents a495e53 + 52741f4 commit 1542cfb

28 files changed

+3404
-139
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
bower_components/
44
temp/
55
tests/coverage/
6+
dist/

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.10.0 (2016-02-28)
2+
## Features
3+
- Added rightToLeft option for RTL support (#270)
4+
15
# 2.9.0 (2016-02-18)
26
## Features
37
- Change `rzSliderOptions` to use expression binding (#266).

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Slider directive implementation for AngularJS, without any dependencies: [http:/
2020
- Simple to use
2121
- Keyboard support
2222
- Compatibility with jQuery Lite, ie. with full jQuery ( Thanks Jusas! https://github.com/Jusas)
23+
- Supports right to left
2324

2425
**Horizontal**
2526

@@ -202,7 +203,8 @@ The default options are:
202203
onlyBindHandles: false,
203204
onStart: null,
204205
onChange: null,
205-
onEnd: null
206+
onEnd: null,
207+
rightToLeft: false
206208
}
207209
````
208210

@@ -295,6 +297,8 @@ $scope.slider = {
295297

296298
**onEnd** - _Function(sliderId, modelValue, highValue)_: Function to be called when a slider update is ended. If an id was set in the options, then it's passed to this callback.
297299

300+
**rightToLeft** - _Boolean (defaults to false)_: Set to true to show graphs right to left. If **vertical** is true it reverses the left / right arrow functions
301+
298302
**vertical** - _Boolean (defaults to false)_: Set to true to display the slider vertically. The slider will take the full height of its parent.
299303
_Changing this value at runtime is not currently supported._
300304

demo/demo.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $modal) {
112112
}
113113
};
114114

115+
//Right to left slider with floor, ceil and step
116+
$scope.slider_floor_ceil_rtl = {
117+
value: 12,
118+
options: {
119+
floor: 10,
120+
ceil: 100,
121+
step: 5,
122+
rightToLeft: true
123+
}
124+
}
125+
115126
//Slider config with callbacks
116127
$scope.slider_callbacks = {
117128
value: 100,

demo/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ <h2>Slider with custom floor/ceil/step</h2>
102102
></rzslider>
103103
</article>
104104

105+
<article>
106+
<h2>Right to left slider with custom floor/ceil/step</h2>
107+
<rzslider
108+
rz-slider-model="slider_floor_ceil_rtl.value"
109+
rz-slider-options="slider_floor_ceil_rtl.options"
110+
></rzslider>
111+
</article>
112+
105113
<article>
106114
<h2>Slider with callbacks on start, change and end</h2>
107115
<p>Value linked on start: {{ otherData.start }}</p>
@@ -289,7 +297,8 @@ <h2>Slider with all options demo</h2>
289297
<label>Show ticks <input type="checkbox" ng-model="slider_all_options.options.showTicks"></label><br/>
290298
<label>Show ticks values <input type="checkbox" ng-model="slider_all_options.options.showTicksValues"></label><br/>
291299
<label>Disabled <input type="checkbox" ng-model="slider_all_options.options.disabled"></label><br/>
292-
<label>Read-Only <input type="checkbox" ng-model="slider_all_options.options.readOnly"></label>
300+
<label>Read-Only <input type="checkbox" ng-model="slider_all_options.options.readOnly"></label><br />
301+
<label>Right to Left <input type="checkbox" ng-model="slider_all_options.options.rightToLeft"></label>
293302
</div>
294303
</div>
295304
<rzslider

dist/rzslider.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*! angularjs-slider - v2.9.0 -
22
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> -
33
https://github.com/angular-slider/angularjs-slider -
4-
2016-02-24 */
4+
2016-02-28 */
55
rzslider {
66
position: relative;
77
display: inline-block;

0 commit comments

Comments
 (0)