Skip to content

Commit 0693062

Browse files
committed
Presentation mode. Close angular-slider#57
1 parent 47d4cf1 commit 0693062

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ $scope.priceSlider = {
9898

9999
> Set to true to always show selection bar
100100
101+
**rz-slider-present-only**
102+
103+
> When set to true slider is used in presentation mode. No handle dragging.
104+
101105
**rz-slider-translate**
102106

103107
> Custom translate function. Use this if you want to translate values displayed on the slider. For example if you want to display dollar amounts instead of just numbers do this:

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-slider",
3-
"version": "0.1.17",
3+
"version": "0.1.18",
44
"homepage": "https://github.com/rzajac/angularjs-slider",
55
"authors": [
66
"Rafal Zajac <rzajac@gmail.com>",

dist/rzslider.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rzslider.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jusas-angularjs-slider",
3-
"version": "0.1.17",
3+
"version": "0.1.18",
44
"description": "AngularJS slider directive with no external dependencies. Mobile friendly!.",
55
"main": "rzslider.js",
66
"repository": {

rzslider.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (c) Rafal Zajac <rzajac@gmail.com>
55
* http://github.com/rzajac/angularjs-slider
66
*
7-
* Version: v0.1.17
7+
* Version: v0.1.18
88
*
99
* Licensed under the MIT license
1010
*/
@@ -177,6 +177,16 @@ function throttle(func, wait, options) {
177177
*/
178178
this.hideLimitLabels = !!attributes.rzSliderHideLimitLabels;
179179

180+
/**
181+
* Only present model values
182+
*
183+
* Do not allow to change values
184+
*
185+
* @type {boolean}
186+
*/
187+
this.presentOnly = attributes.rzSliderPresentOnly === 'true';
188+
189+
console.log(this.presentOnly); // TODO: remove this!
180190
/**
181191
* The delta between min and max value
182192
*
@@ -239,7 +249,7 @@ function throttle(func, wait, options) {
239249
self.updateCeilLab();
240250
self.updateFloorLab();
241251
self.initHandles();
242-
self.bindEvents();
252+
if (!self.presentOnly) { self.bindEvents(); }
243253
});
244254

245255
// Recalculate slider view dimensions
@@ -995,7 +1005,8 @@ function throttle(func, wait, options) {
9951005
rzSliderHigh: '=?',
9961006
rzSliderTranslate: '&',
9971007
rzSliderHideLimitLabels: '=?',
998-
rzSliderAlwaysShowBar: '=?'
1008+
rzSliderAlwaysShowBar: '=?',
1009+
rzSliderPresentOnly: '@'
9991010
},
10001011

10011012
/**

0 commit comments

Comments
 (0)