Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
i20rzslider
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jedife
i20rzslider
Commits
b7a01c58
Commit
b7a01c58
authored
Sep 10, 2015
by
Valentin Hervieu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a rzSliderShowTicks attribute.
parent
6e5ffa50
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
148 additions
and
15 deletions
+148
-15
README.md
README.md
+6
-1
index.html
demo/index.html
+10
-0
rzslider.css
dist/rzslider.css
+23
-3
rzslider.js
dist/rzslider.js
+40
-2
rzslider.min.css
dist/rzslider.min.css
+2
-2
rzslider.min.js
dist/rzslider.min.js
+2
-2
rzSliderTpl.html
src/rzSliderTpl.html
+2
-1
rzslider.js
src/rzslider.js
+39
-1
rzslider.less
src/rzslider.less
+24
-3
No files found.
README.md
View file @
b7a01c58
...
...
@@ -127,6 +127,10 @@ $scope.priceSlider = {
> Function to be called when a slider update is ended.
**rz-slider-show-ticks**
> Display a tick for each value.
```
javascript
// In your controller
...
...
@@ -155,7 +159,8 @@ $scope.onSliderChange = function()
rz-slider-model=
"priceSlider.min"
rz-slider-high=
"priceSlider.max"
rz-slider-translate=
"translate"
rz-slider-on-change=
"onSliderChange()"
></rzslider>
rz-slider-on-change=
"onSliderChange()"
rz-slider-show-ticks=
"true"
></rzslider>
```
## Slider events
...
...
demo/index.html
View file @
b7a01c58
...
...
@@ -85,6 +85,15 @@
rz-slider-tpl-url=
"rzSliderTpl.html"
></rzslider>
</article>
<article>
<h2>
Slider with ticks example
</h2>
Value: {{ priceSlider4 | json }}
<rzslider
rz-slider-model=
"priceSlider4"
rz-slider-floor=
"0"
rz-slider-ceil=
"10"
rz-slider-show-ticks=
"true"
></rzslider>
</article>
<article>
<h2>
Draggable range example
</h2>
Value:
...
...
@@ -131,6 +140,7 @@
$scope
.
priceSlider2
=
150
;
$scope
.
priceSlider3
=
250
;
$scope
.
priceSlider4
=
5
;
$scope
.
translate
=
function
(
value
)
{
return
'$'
+
value
;
...
...
dist/rzslider.css
View file @
b7a01c58
...
...
@@ -34,6 +34,7 @@ rzslider span.rz-base {
rzslider
span
.rz-bar-wrapper
{
left
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
32px
;
padding-top
:
16px
;
...
...
@@ -43,7 +44,7 @@ rzslider span.rz-bar-wrapper {
rzslider
span
.rz-bar
{
left
:
0
;
z-index
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
4px
;
background
:
#d8e0f3
;
...
...
@@ -53,7 +54,7 @@ rzslider span.rz-bar {
}
rzslider
span
.rz-bar.rz-selection
{
z-index
:
1
;
z-index
:
2
;
background
:
#0db9f0
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
...
...
@@ -62,7 +63,7 @@ rzslider span.rz-bar.rz-selection {
rzslider
span
.rz-pointer
{
top
:
-14px
;
z-index
:
2
;
z-index
:
3
;
width
:
32px
;
height
:
32px
;
cursor
:
pointer
;
...
...
@@ -106,4 +107,23 @@ rzslider span.rz-bubble.rz-selection {
rzslider
span
.rz-bubble.rz-limit
{
color
:
#55637d
;
}
rzslider
.rz-ticks
{
position
:
absolute
;
top
:
-3px
;
z-index
:
1
;
display
:
flex
;
padding
:
0
;
margin
:
0
;
list-style
:
none
;
justify-content
:
space-between
;
}
rzslider
.rz-ticks
li
{
width
:
10px
;
height
:
10px
;
cursor
:
pointer
;
background
:
#666666
;
border-radius
:
50%
;
}
\ No newline at end of file
dist/rzslider.js
View file @
b7a01c58
...
...
@@ -211,6 +211,13 @@ function throttle(func, wait, options) {
*/
this
.
presentOnly
=
attributes
.
rzSliderPresentOnly
===
'true'
;
/**
* Display ticks on each possible value.
*
* @type {boolean}
*/
this
.
showTicks
=
attributes
.
rzSliderShowTicks
===
'true'
;
/**
* The delta between min and max value
*
...
...
@@ -249,6 +256,7 @@ function throttle(func, wait, options) {
this
.
minLab
=
null
;
// Label above the low value
this
.
maxLab
=
null
;
// Label above the high value
this
.
cmbLab
=
null
;
// Combined label
this
.
ticks
=
null
;
// The ticks
// Initialize slider
this
.
init
();
...
...
@@ -281,6 +289,8 @@ function throttle(func, wait, options) {
self
.
updateFloorLab
();
self
.
initHandles
();
if
(
!
self
.
presentOnly
)
{
self
.
bindEvents
();
}
if
(
self
.
showTicks
)
self
.
updateTicksScale
();
});
// Recalculate slider view dimensions
...
...
@@ -359,6 +369,7 @@ function throttle(func, wait, options) {
self
.
maxH
.
off
();
self
.
fullBar
.
off
();
self
.
selBar
.
off
();
self
.
ticks
.
off
();
angular
.
element
(
$window
).
off
(
'resize'
,
calcDimFn
);
self
.
deRegFuncs
.
map
(
function
(
unbind
)
{
unbind
();
});
});
...
...
@@ -493,6 +504,7 @@ function throttle(func, wait, options) {
case
6
:
this
.
minLab
=
jElem
;
break
;
case
7
:
this
.
maxLab
=
jElem
;
break
;
case
8
:
this
.
cmbLab
=
jElem
;
break
;
case
9
:
this
.
ticks
=
jElem
;
break
;
}
},
this
);
...
...
@@ -506,6 +518,7 @@ function throttle(func, wait, options) {
this
.
minLab
.
rzsl
=
0
;
this
.
maxLab
.
rzsl
=
0
;
this
.
cmbLab
.
rzsl
=
0
;
this
.
ticks
.
rzsl
=
0
;
// Hide limit labels
if
(
this
.
hideLimitLabels
)
...
...
@@ -561,6 +574,8 @@ function throttle(func, wait, options) {
this
.
getWidth
(
this
.
sliderElem
);
this
.
sliderElem
.
rzsl
=
this
.
sliderElem
[
0
].
getBoundingClientRect
().
left
;
if
(
this
.
showTicks
)
this
.
updateTicksScale
();
if
(
this
.
initHasRun
)
{
...
...
@@ -569,6 +584,24 @@ function throttle(func, wait, options) {
}
},
/**
* Update the ticks position
*
* @returns {undefined}
*/
updateTicksScale
:
function
()
{
var
positions
=
''
;
for
(
var
i
=
this
.
minValue
;
i
<
this
.
maxValue
;
i
+=
this
.
step
)
{
positions
+=
'<li></li>'
;
}
positions
+=
'<li></li>'
;
this
.
ticks
.
html
(
positions
);
this
.
ticks
.
css
({
width
:
(
this
.
barWidth
-
2
*
this
.
handleHalfWidth
)
+
'px'
,
left
:
this
.
handleHalfWidth
+
'px'
});
},
/**
* Update position of the ceiling label
*
...
...
@@ -974,6 +1007,8 @@ function throttle(func, wait, options) {
this
.
fullBar
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
));
this
.
selBar
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
barStart
,
null
,
barTracking
));
this
.
selBar
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
barMove
,
this
.
selBar
));
this
.
ticks
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
this
.
onStart
,
null
,
null
));
this
.
ticks
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
ticks
));
this
.
minH
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onStart
,
this
.
minH
,
'rzSliderModel'
));
if
(
this
.
range
)
{
this
.
maxH
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onStart
,
this
.
maxH
,
'rzSliderHigh'
));
}
...
...
@@ -981,6 +1016,8 @@ function throttle(func, wait, options) {
this
.
fullBar
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
));
this
.
selBar
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
barStart
,
null
,
barTracking
));
this
.
selBar
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
barMove
,
this
.
selBar
));
this
.
ticks
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onStart
,
null
,
null
));
this
.
ticks
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
ticks
));
},
/**
...
...
@@ -1266,7 +1303,8 @@ function throttle(func, wait, options) {
rzSliderPresentOnly
:
'@'
,
rzSliderOnStart
:
'&'
,
rzSliderOnChange
:
'&'
,
rzSliderOnEnd
:
'&'
rzSliderOnEnd
:
'&'
,
rzSliderShowTicks
:
'@'
},
/**
...
...
@@ -1325,7 +1363,7 @@ function throttle(func, wait, options) {
'use strict'
;
$templateCache
.
put
(
'rzSliderTpl.html'
,
"<span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=
\"
rz-bar rz-selection
\"
></span></span> <span class=rz-pointer></span> <span class=rz-pointer></span> <span class=
\"
rz-bubble rz-limit
\"
></span> <span class=
\"
rz-bubble rz-limit
\"
></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span>"
"<span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=
\"
rz-bar rz-selection
\"
></span></span> <span class=rz-pointer></span> <span class=rz-pointer></span> <span class=
\"
rz-bubble rz-limit
\"
></span> <span class=
\"
rz-bubble rz-limit
\"
></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span>
<ul class=rz-ticks></ul>
"
);
}]);
...
...
dist/rzslider.min.css
View file @
b7a01c58
/*! jusas-angularjs-slider - v0.1.32 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-09-24 */
rzslider
{
position
:
relative
;
display
:
inline-block
;
width
:
100%
;
height
:
4px
;
margin
:
30px
0
15px
0
;
vertical-align
:
middle
}
rzslider
span
{
position
:
absolute
;
display
:
inline-block
;
white-space
:
nowrap
}
rzslider
span
.rz-base
{
width
:
100%
;
height
:
100%
;
padding
:
0
}
rzslider
span
.rz-bar-wrapper
{
left
:
0
;
width
:
100%
;
height
:
32px
;
padding-top
:
16px
;
margin-top
:
-16px
;
box-sizing
:
border-box
}
rzslider
span
.rz-bar
{
left
:
0
;
z-index
:
0
;
width
:
100%
;
height
:
4px
;
background
:
#d8e0f3
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
border-radius
:
2px
}
rzslider
span
.rz-bar.rz-selection
{
z-index
:
1
;
background
:
#0db9f0
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
border-radius
:
2px
}
rzslider
span
.rz-pointer
{
top
:
-14px
;
z-index
:
2
;
width
:
32px
;
height
:
32px
;
cursor
:
pointer
;
background-color
:
#0db9f0
;
-webkit-border-radius
:
16px
;
-moz-border-radius
:
16px
;
border-radius
:
16px
}
rzslider
span
.rz-pointer
:after
{
position
:
absolute
;
top
:
12px
;
left
:
12px
;
width
:
8px
;
height
:
8px
;
background
:
#fff
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
content
:
''
}
rzslider
span
.rz-pointer
:hover:after
{
background-color
:
#fff
}
rzslider
span
.rz-pointer.rz-active
:after
{
background-color
:
#451aff
}
rzslider
span
.rz-bubble
{
top
:
-32px
;
padding
:
1px
3px
;
color
:
#55637d
;
cursor
:
default
}
rzslider
span
.rz-bubble.rz-selection
{
top
:
16px
}
rzslider
span
.rz-bubble.rz-limit
{
color
:
#55637d
}
\ No newline at end of file
/*! jusas-angularjs-slider - v0.1.32 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-10-02 */
rzslider
{
position
:
relative
;
display
:
inline-block
;
width
:
100%
;
height
:
4px
;
margin
:
30px
0
15px
0
;
vertical-align
:
middle
}
rzslider
span
{
position
:
absolute
;
display
:
inline-block
;
white-space
:
nowrap
}
rzslider
span
.rz-base
{
width
:
100%
;
height
:
100%
;
padding
:
0
}
rzslider
span
.rz-bar-wrapper
{
left
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
32px
;
padding-top
:
16px
;
margin-top
:
-16px
;
box-sizing
:
border-box
}
rzslider
span
.rz-bar
{
left
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
4px
;
background
:
#d8e0f3
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
border-radius
:
2px
}
rzslider
span
.rz-bar.rz-selection
{
z-index
:
2
;
background
:
#0db9f0
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
border-radius
:
2px
}
rzslider
span
.rz-pointer
{
top
:
-14px
;
z-index
:
3
;
width
:
32px
;
height
:
32px
;
cursor
:
pointer
;
background-color
:
#0db9f0
;
-webkit-border-radius
:
16px
;
-moz-border-radius
:
16px
;
border-radius
:
16px
}
rzslider
span
.rz-pointer
:after
{
position
:
absolute
;
top
:
12px
;
left
:
12px
;
width
:
8px
;
height
:
8px
;
background
:
#fff
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
content
:
''
}
rzslider
span
.rz-pointer
:hover:after
{
background-color
:
#fff
}
rzslider
span
.rz-pointer.rz-active
:after
{
background-color
:
#451aff
}
rzslider
span
.rz-bubble
{
top
:
-32px
;
padding
:
1px
3px
;
color
:
#55637d
;
cursor
:
default
}
rzslider
span
.rz-bubble.rz-selection
{
top
:
16px
}
rzslider
span
.rz-bubble.rz-limit
{
color
:
#55637d
}
rzslider
.rz-ticks
{
position
:
absolute
;
top
:
-3px
;
z-index
:
1
;
display
:
flex
;
padding
:
0
;
margin
:
0
;
list-style
:
none
;
justify-content
:
space-between
}
rzslider
.rz-ticks
li
{
width
:
10px
;
height
:
10px
;
cursor
:
pointer
;
background
:
#666
;
border-radius
:
50%
}
\ No newline at end of file
dist/rzslider.min.js
View file @
b7a01c58
/*! jusas-angularjs-slider - v0.1.32 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-09-24 */
!
function
(
a
,
b
){
"use strict"
;
"function"
==
typeof
define
&&
define
.
amd
?
define
([
"angular"
],
b
):
"object"
==
typeof
module
&&
module
.
exports
?
module
.
exports
=
b
(
require
(
"angular"
)):
b
(
a
.
angular
)}(
this
,
function
(
a
){
"use strict"
;
var
b
=
a
.
module
(
"rzModule"
,[]).
value
(
"throttle"
,
function
(
a
,
b
,
c
){
var
d
,
e
,
f
,
g
=
Date
.
now
||
function
(){
return
(
new
Date
).
getTime
()},
h
=
null
,
i
=
0
;
c
=
c
||
{};
var
j
=
function
(){
i
=
c
.
leading
===!
1
?
0
:
g
(),
h
=
null
,
f
=
a
.
apply
(
d
,
e
),
d
=
e
=
null
};
return
function
(){
var
k
=
g
();
i
||
c
.
leading
!==!
1
||
(
i
=
k
);
var
l
=
b
-
(
k
-
i
);
return
d
=
this
,
e
=
arguments
,
0
>=
l
?(
clearTimeout
(
h
),
h
=
null
,
i
=
k
,
f
=
a
.
apply
(
d
,
e
),
d
=
e
=
null
):
h
||
c
.
trailing
===!
1
||
(
h
=
setTimeout
(
j
,
l
)),
f
}}).
factory
(
"RzSlider"
,[
"$timeout"
,
"$document"
,
"$window"
,
"throttle"
,
function
(
b
,
c
,
d
,
e
){
var
f
=
function
(
a
,
b
,
c
){
this
.
scope
=
a
,
this
.
attributes
=
c
,
this
.
sliderElem
=
b
,
this
.
range
=
void
0
!==
c
.
rzSliderHigh
&&
void
0
!==
c
.
rzSliderModel
,
this
.
dragRange
=
this
.
range
&&
"true"
===
c
.
rzSliderDraggableRange
,
this
.
dragging
=
{
active
:
!
1
,
value
:
0
,
difference
:
0
,
offset
:
0
,
lowDist
:
0
,
highDist
:
0
},
this
.
handleHalfWidth
=
0
,
this
.
alwaysShowBar
=!!
c
.
rzSliderAlwaysShowBar
,
this
.
maxLeft
=
0
,
this
.
precision
=
0
,
this
.
step
=
0
,
this
.
tracking
=
""
,
this
.
minValue
=
0
,
this
.
maxValue
=
0
,
this
.
hideLimitLabels
=!!
c
.
rzSliderHideLimitLabels
,
this
.
presentOnly
=
"true"
===
c
.
rzSliderPresentOnly
,
this
.
valueRange
=
0
,
this
.
initHasRun
=!
1
,
this
.
customTrFn
=
this
.
scope
.
rzSliderTranslate
()
||
function
(
a
){
return
String
(
a
)},
this
.
deRegFuncs
=
[],
this
.
fullBar
=
null
,
this
.
selBar
=
null
,
this
.
minH
=
null
,
this
.
maxH
=
null
,
this
.
flrLab
=
null
,
this
.
ceilLab
=
null
,
this
.
minLab
=
null
,
this
.
maxLab
=
null
,
this
.
cmbLab
=
null
,
this
.
init
()};
return
f
.
prototype
=
{
init
:
function
(){
var
c
,
f
,
g
,
h
=
a
.
bind
(
this
,
this
.
calcViewDimensions
),
i
=
this
;
this
.
initElemHandles
(),
this
.
calcViewDimensions
(),
this
.
setMinAndMax
(),
this
.
precision
=
void
0
===
this
.
scope
.
rzSliderPrecision
?
0
:
+
this
.
scope
.
rzSliderPrecision
,
this
.
step
=
void
0
===
this
.
scope
.
rzSliderStep
?
1
:
+
this
.
scope
.
rzSliderStep
,
b
(
function
(){
i
.
updateCeilLab
(),
i
.
updateFloorLab
(),
i
.
initHandles
(),
i
.
presentOnly
||
i
.
bindEvents
()}),
g
=
this
.
scope
.
$on
(
"reCalcViewDimensions"
,
h
),
this
.
deRegFuncs
.
push
(
g
),
a
.
element
(
d
).
on
(
"resize"
,
h
),
this
.
initHasRun
=!
0
,
c
=
e
(
function
(){
i
.
setMinAndMax
(),
i
.
updateLowHandle
(
i
.
valueToOffset
(
i
.
scope
.
rzSliderModel
)),
i
.
updateSelectionBar
(),
i
.
range
&&
i
.
updateCmbLabel
()},
350
,{
leading
:
!
1
}),
f
=
e
(
function
(){
i
.
setMinAndMax
(),
i
.
updateHighHandle
(
i
.
valueToOffset
(
i
.
scope
.
rzSliderHigh
)),
i
.
updateSelectionBar
(),
i
.
updateCmbLabel
()},
350
,{
leading
:
!
1
}),
this
.
scope
.
$on
(
"rzSliderForceRender"
,
function
(){
i
.
resetLabelsValue
(),
c
(),
i
.
range
&&
f
(),
i
.
resetSlider
()}),
g
=
this
.
scope
.
$watch
(
"rzSliderModel"
,
function
(
a
,
b
){
a
!==
b
&&
c
()}),
this
.
deRegFuncs
.
push
(
g
),
g
=
this
.
scope
.
$watch
(
"rzSliderHigh"
,
function
(
a
,
b
){
a
!==
b
&&
f
()}),
this
.
deRegFuncs
.
push
(
g
),
this
.
scope
.
$watch
(
"rzSliderFloor"
,
function
(
a
,
b
){
a
!==
b
&&
i
.
resetSlider
()}),
this
.
deRegFuncs
.
push
(
g
),
g
=
this
.
scope
.
$watch
(
"rzSliderCeil"
,
function
(
a
,
b
){
a
!==
b
&&
i
.
resetSlider
()}),
this
.
deRegFuncs
.
push
(
g
),
this
.
scope
.
$on
(
"$destroy"
,
function
(){
i
.
minH
.
off
(),
i
.
maxH
.
off
(),
i
.
fullBar
.
off
(),
i
.
selBar
.
off
(),
a
.
element
(
d
).
off
(
"resize"
,
h
),
i
.
deRegFuncs
.
map
(
function
(
a
){
a
()})})},
resetSlider
:
function
(){
this
.
setMinAndMax
(),
this
.
updateCeilLab
(),
this
.
updateFloorLab
(),
this
.
calcViewDimensions
()},
resetLabelsValue
:
function
(){
this
.
minLab
.
rzsv
=
void
0
,
this
.
maxLab
.
rzsv
=
void
0
},
initHandles
:
function
(){
this
.
updateLowHandle
(
this
.
valueToOffset
(
this
.
scope
.
rzSliderModel
)),
this
.
range
&&
(
this
.
updateHighHandle
(
this
.
valueToOffset
(
this
.
scope
.
rzSliderHigh
)),
this
.
updateCmbLabel
()),
this
.
updateSelectionBar
()},
translateFn
:
function
(
a
,
b
,
c
){
c
=
void
0
===
c
?
!
0
:
c
;
var
d
=
(
c
?
this
.
customTrFn
(
a
):
a
).
toString
(),
e
=!
1
;(
void
0
===
b
.
rzsv
||
b
.
rzsv
.
length
!==
d
.
length
||
b
.
rzsv
.
length
>
0
&&
0
===
b
.
rzsw
)
&&
(
e
=!
0
,
b
.
rzsv
=
d
),
b
.
text
(
d
),
e
&&
this
.
getWidth
(
b
)},
setMinAndMax
:
function
(){
this
.
scope
.
rzSliderFloor
?
this
.
minValue
=+
this
.
scope
.
rzSliderFloor
:
this
.
minValue
=
this
.
scope
.
rzSliderFloor
=
0
,
this
.
scope
.
rzSliderCeil
?
this
.
maxValue
=+
this
.
scope
.
rzSliderCeil
:
this
.
maxValue
=
this
.
scope
.
rzSliderCeil
=
this
.
range
?
this
.
scope
.
rzSliderHigh
:
this
.
scope
.
rzSliderModel
,
this
.
scope
.
rzSliderStep
&&
(
this
.
step
=+
this
.
scope
.
rzSliderStep
),
this
.
valueRange
=
this
.
maxValue
-
this
.
minValue
},
initElemHandles
:
function
(){
a
.
forEach
(
this
.
sliderElem
.
children
(),
function
(
b
,
c
){
var
d
=
a
.
element
(
b
);
switch
(
c
){
case
0
:
this
.
fullBar
=
d
;
break
;
case
1
:
this
.
selBar
=
d
;
break
;
case
2
:
this
.
minH
=
d
;
break
;
case
3
:
this
.
maxH
=
d
;
break
;
case
4
:
this
.
flrLab
=
d
;
break
;
case
5
:
this
.
ceilLab
=
d
;
break
;
case
6
:
this
.
minLab
=
d
;
break
;
case
7
:
this
.
maxLab
=
d
;
break
;
case
8
:
this
.
cmbLab
=
d
}},
this
),
this
.
selBar
.
rzsl
=
0
,
this
.
minH
.
rzsl
=
0
,
this
.
maxH
.
rzsl
=
0
,
this
.
flrLab
.
rzsl
=
0
,
this
.
ceilLab
.
rzsl
=
0
,
this
.
minLab
.
rzsl
=
0
,
this
.
maxLab
.
rzsl
=
0
,
this
.
cmbLab
.
rzsl
=
0
,
this
.
hideLimitLabels
&&
(
this
.
flrLab
.
rzAlwaysHide
=!
0
,
this
.
ceilLab
.
rzAlwaysHide
=!
0
,
this
.
hideEl
(
this
.
flrLab
),
this
.
hideEl
(
this
.
ceilLab
)),
this
.
range
===!
1
&&
(
this
.
cmbLab
.
remove
(),
this
.
maxLab
.
remove
(),
this
.
maxH
.
rzAlwaysHide
=!
0
,
this
.
maxH
[
0
].
style
.
zIndex
=
"-1000"
,
this
.
hideEl
(
this
.
maxH
)),
this
.
range
===!
1
&&
this
.
alwaysShowBar
===!
1
&&
(
this
.
maxH
.
remove
(),
this
.
selBar
.
remove
()),
this
.
dragRange
&&
(
this
.
selBar
.
css
(
"cursor"
,
"move"
),
this
.
selBar
.
addClass
(
"rz-draggable"
))},
calcViewDimensions
:
function
(){
var
a
=
this
.
getWidth
(
this
.
minH
);
this
.
handleHalfWidth
=
a
/
2
,
this
.
barWidth
=
this
.
getWidth
(
this
.
fullBar
),
this
.
maxLeft
=
this
.
barWidth
-
a
,
this
.
getWidth
(
this
.
sliderElem
),
this
.
sliderElem
.
rzsl
=
this
.
sliderElem
[
0
].
getBoundingClientRect
().
left
,
this
.
initHasRun
&&
(
this
.
updateCeilLab
(),
this
.
initHandles
())},
updateCeilLab
:
function
(){
this
.
translateFn
(
this
.
scope
.
rzSliderCeil
,
this
.
ceilLab
),
this
.
setLeft
(
this
.
ceilLab
,
this
.
barWidth
-
this
.
ceilLab
.
rzsw
),
this
.
getWidth
(
this
.
ceilLab
)},
updateFloorLab
:
function
(){
this
.
translateFn
(
this
.
scope
.
rzSliderFloor
,
this
.
flrLab
),
this
.
getWidth
(
this
.
flrLab
)},
callOnStart
:
function
(){
if
(
this
.
scope
.
rzSliderOnStart
){
var
a
=
this
;
b
(
function
(){
a
.
scope
.
rzSliderOnStart
()})}},
callOnChange
:
function
(){
if
(
this
.
scope
.
rzSliderOnChange
){
var
a
=
this
;
b
(
function
(){
a
.
scope
.
rzSliderOnChange
()})}},
callOnEnd
:
function
(){
if
(
this
.
scope
.
rzSliderOnEnd
){
var
a
=
this
;
b
(
function
(){
a
.
scope
.
rzSliderOnEnd
()})}},
updateHandles
:
function
(
a
,
b
){
return
"rzSliderModel"
===
a
?(
this
.
updateLowHandle
(
b
),
this
.
updateSelectionBar
(),
void
(
this
.
range
&&
this
.
updateCmbLabel
())):
"rzSliderHigh"
===
a
?(
this
.
updateHighHandle
(
b
),
this
.
updateSelectionBar
(),
void
(
this
.
range
&&
this
.
updateCmbLabel
())):(
this
.
updateLowHandle
(
b
),
this
.
updateHighHandle
(
b
),
this
.
updateSelectionBar
(),
void
this
.
updateCmbLabel
())},
updateLowHandle
:
function
(
a
){
var
b
=
Math
.
abs
(
this
.
minH
.
rzsl
-
a
);
this
.
minLab
.
rzsv
&&
1
>
b
||
(
this
.
setLeft
(
this
.
minH
,
a
),
this
.
translateFn
(
this
.
scope
.
rzSliderModel
,
this
.
minLab
),
this
.
setLeft
(
this
.
minLab
,
a
-
this
.
minLab
.
rzsw
/
2
+
this
.
handleHalfWidth
),
this
.
shFloorCeil
())},
updateHighHandle
:
function
(
a
){
this
.
setLeft
(
this
.
maxH
,
a
),
this
.
translateFn
(
this
.
scope
.
rzSliderHigh
,
this
.
maxLab
),
this
.
setLeft
(
this
.
maxLab
,
a
-
this
.
maxLab
.
rzsw
/
2
+
this
.
handleHalfWidth
),
this
.
shFloorCeil
()},
shFloorCeil
:
function
(){
var
a
=!
1
,
b
=!
1
;
this
.
minLab
.
rzsl
<=
this
.
flrLab
.
rzsl
+
this
.
flrLab
.
rzsw
+
5
?(
a
=!
0
,
this
.
hideEl
(
this
.
flrLab
)):(
a
=!
1
,
this
.
showEl
(
this
.
flrLab
)),
this
.
minLab
.
rzsl
+
this
.
minLab
.
rzsw
>=
this
.
ceilLab
.
rzsl
-
this
.
handleHalfWidth
-
10
?(
b
=!
0
,
this
.
hideEl
(
this
.
ceilLab
)):(
b
=!
1
,
this
.
showEl
(
this
.
ceilLab
)),
this
.
range
&&
(
this
.
maxLab
.
rzsl
+
this
.
maxLab
.
rzsw
>=
this
.
ceilLab
.
rzsl
-
10
?
this
.
hideEl
(
this
.
ceilLab
):
b
||
this
.
showEl
(
this
.
ceilLab
),
this
.
maxLab
.
rzsl
<=
this
.
flrLab
.
rzsl
+
this
.
flrLab
.
rzsw
+
this
.
handleHalfWidth
?
this
.
hideEl
(
this
.
flrLab
):
a
||
this
.
showEl
(
this
.
flrLab
))},
updateSelectionBar
:
function
(){
this
.
setWidth
(
this
.
selBar
,
Math
.
abs
(
this
.
maxH
.
rzsl
-
this
.
minH
.
rzsl
)),
this
.
setLeft
(
this
.
selBar
,
this
.
range
?
this
.
minH
.
rzsl
+
this
.
handleHalfWidth
:
0
)},
updateCmbLabel
:
function
(){
var
a
,
b
;
this
.
minLab
.
rzsl
+
this
.
minLab
.
rzsw
+
10
>=
this
.
maxLab
.
rzsl
?(
this
.
customTrFn
?(
a
=
this
.
customTrFn
(
this
.
scope
.
rzSliderModel
),
b
=
this
.
customTrFn
(
this
.
scope
.
rzSliderHigh
)):(
a
=
this
.
scope
.
rzSliderModel
,
b
=
this
.
scope
.
rzSliderHigh
),
this
.
translateFn
(
a
+
" - "
+
b
,
this
.
cmbLab
,
!
1
),
this
.
setLeft
(
this
.
cmbLab
,
this
.
selBar
.
rzsl
+
this
.
selBar
.
rzsw
/
2
-
this
.
cmbLab
.
rzsw
/
2
),
this
.
hideEl
(
this
.
minLab
),
this
.
hideEl
(
this
.
maxLab
),
this
.
showEl
(
this
.
cmbLab
)):(
this
.
showEl
(
this
.
maxLab
),
this
.
showEl
(
this
.
minLab
),
this
.
hideEl
(
this
.
cmbLab
))},
roundStep
:
function
(
a
){
var
b
=
this
.
step
,
c
=+
((
a
-
this
.
minValue
)
%
b
).
toFixed
(
3
),
d
=
c
>
b
/
2
?
a
+
b
-
c
:
a
-
c
;
return
d
=
d
.
toFixed
(
this
.
precision
),
+
d
},
hideEl
:
function
(
a
){
return
a
.
css
({
opacity
:
0
})},
showEl
:
function
(
a
){
return
a
.
rzAlwaysHide
?
a
:
a
.
css
({
opacity
:
1
})},
setLeft
:
function
(
a
,
b
){
return
a
.
rzsl
=
b
,
a
.
css
({
left
:
b
+
"px"
}),
b
},
getWidth
:
function
(
a
){
var
b
=
a
[
0
].
getBoundingClientRect
();
return
a
.
rzsw
=
b
.
right
-
b
.
left
,
a
.
rzsw
},
setWidth
:
function
(
a
,
b
){
return
a
.
rzsw
=
b
,
a
.
css
({
width
:
b
+
"px"
}),
b
},
valueToOffset
:
function
(
a
){
return
(
a
-
this
.
minValue
)
*
this
.
maxLeft
/
this
.
valueRange
||
0
},
offsetToValue
:
function
(
a
){
return
a
/
this
.
maxLeft
*
this
.
valueRange
+
this
.
minValue
},
getEventX
:
function
(
a
){
return
"clientX"
in
a
?
a
.
clientX
:
void
0
===
a
.
originalEvent
?
a
.
touches
[
0
].
clientX
:
a
.
originalEvent
.
touches
[
0
].
clientX
},
getNearestHandle
:
function
(
a
){
if
(
!
this
.
range
)
return
this
.
minH
;
var
b
=
this
.
getEventX
(
a
)
-
this
.
sliderElem
.
rzsl
-
this
.
handleHalfWidth
;
return
Math
.
abs
(
b
-
this
.
minH
.
rzsl
)
<
Math
.
abs
(
b
-
this
.
maxH
.
rzsl
)?
this
.
minH
:
this
.
maxH
},
bindEvents
:
function
(){
var
b
,
c
,
d
;
this
.
dragRange
?(
b
=
"rzSliderDrag"
,
c
=
this
.
onDragStart
,
d
=
this
.
onDragMove
):(
b
=
"rzSliderModel"
,
c
=
this
.
onStart
,
d
=
this
.
onMove
),
this
.
minH
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
minH
,
"rzSliderModel"
)),
this
.
range
&&
this
.
maxH
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
maxH
,
"rzSliderHigh"
)),
this
.
fullBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
null
,
null
)),
this
.
fullBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
)),
this
.
selBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
c
,
null
,
b
)),
this
.
selBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
d
,
this
.
selBar
)),
this
.
minH
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
minH
,
"rzSliderModel"
)),
this
.
range
&&
this
.
maxH
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
maxH
,
"rzSliderHigh"
)),
this
.
fullBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
null
,
null
)),
this
.
fullBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
)),
this
.
selBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
c
,
null
,
b
)),
this
.
selBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
d
,
this
.
selBar
))},
onStart
:
function
(
b
,
d
,
e
){
var
f
,
g
,
h
=
this
.
getEventNames
(
e
);
e
.
stopPropagation
(),
e
.
preventDefault
(),
""
===
this
.
tracking
&&
(
this
.
calcViewDimensions
(),
b
?
this
.
tracking
=
d
:(
b
=
this
.
getNearestHandle
(
e
),
this
.
tracking
=
b
===
this
.
minH
?
"rzSliderModel"
:
"rzSliderHigh"
),
b
.
addClass
(
"rz-active"
),
f
=
a
.
bind
(
this
,
this
.
dragging
.
active
?
this
.
onDragMove
:
this
.
onMove
,
b
),
g
=
a
.
bind
(
this
,
this
.
onEnd
,
f
),
c
.
on
(
h
.
moveEvent
,
f
),
c
.
one
(
h
.
endEvent
,
g
),
this
.
callOnStart
())},
onMove
:
function
(
a
,
b
){
var
c
,
d
,
e
,
f
=
this
.
getEventX
(
b
);
if
(
c
=
this
.
sliderElem
.
rzsl
,
d
=
f
-
c
-
this
.
handleHalfWidth
,
0
>=
d
){
if
(
0
===
a
.
rzsl
)
return
;
e
=
this
.
minValue
,
d
=
0
}
else
if
(
d
>=
this
.
maxLeft
){
if
(
a
.
rzsl
===
this
.
maxLeft
)
return
;
e
=
this
.
maxValue
,
d
=
this
.
maxLeft
}
else
e
=
this
.
offsetToValue
(
d
),
e
=
this
.
roundStep
(
e
),
d
=
this
.
valueToOffset
(
e
);
this
.
positionTrackingHandle
(
e
,
d
)},
onDragStart
:
function
(
a
,
b
,
c
){
var
d
=
this
.
getEventX
(
c
)
-
this
.
sliderElem
.
rzsl
-
this
.
handleHalfWidth
;
this
.
dragging
=
{
active
:
!
0
,
value
:
this
.
offsetToValue
(
d
),
difference
:
this
.
scope
.
rzSliderHigh
-
this
.
scope
.
rzSliderModel
,
offset
:
d
,
lowDist
:
d
-
this
.
minH
.
rzsl
,
highDist
:
this
.
maxH
.
rzsl
-
d
},
this
.
minH
.
addClass
(
"rz-active"
),
this
.
maxH
.
addClass
(
"rz-active"
),
this
.
onStart
(
a
,
b
,
c
)},
onDragMove
:
function
(
a
,
b
){
var
c
,
d
,
e
,
f
,
g
=
this
.
getEventX
(
b
)
-
this
.
sliderElem
.
rzsl
-
this
.
handleHalfWidth
;
if
(
g
<=
this
.
dragging
.
lowDist
){
if
(
a
.
rzsl
===
this
.
dragging
.
lowDist
)
return
;
e
=
this
.
minValue
,
c
=
0
,
f
=
this
.
dragging
.
difference
,
d
=
this
.
valueToOffset
(
f
)}
else
if
(
g
>=
this
.
maxLeft
-
this
.
dragging
.
highDist
){
if
(
a
.
rzsl
===
this
.
dragging
.
highDist
)
return
;
f
=
this
.
maxValue
,
d
=
this
.
maxLeft
,
e
=
this
.
maxValue
-
this
.
dragging
.
difference
,
c
=
this
.
valueToOffset
(
e
)}
else
e
=
this
.
offsetToValue
(
g
-
this
.
dragging
.
lowDist
),
e
=
this
.
roundStep
(
e
),
c
=
this
.
valueToOffset
(
e
),
f
=
e
+
this
.
dragging
.
difference
,
d
=
this
.
valueToOffset
(
f
);
this
.
positionTrackingBar
(
e
,
f
,
c
,
d
)},
positionTrackingBar
:
function
(
a
,
b
,
c
,
d
){
this
.
scope
.
rzSliderModel
=
a
,
this
.
scope
.
rzSliderHigh
=
b
,
this
.
updateHandles
(
"rzSliderModel"
,
c
),
this
.
updateHandles
(
"rzSliderHigh"
,
d
),
this
.
scope
.
$apply
(),
this
.
callOnChange
()},
positionTrackingHandle
:
function
(
a
,
b
){
this
.
range
&&
(
"rzSliderModel"
===
this
.
tracking
&&
a
>=
this
.
scope
.
rzSliderHigh
?(
this
.
scope
[
this
.
tracking
]
=
this
.
scope
.
rzSliderHigh
,
this
.
updateHandles
(
this
.
tracking
,
this
.
maxH
.
rzsl
),
this
.
tracking
=
"rzSliderHigh"
,
this
.
minH
.
removeClass
(
"rz-active"
),
this
.
maxH
.
addClass
(
"rz-active"
),
this
.
scope
.
$apply
(),
this
.
callOnChange
()):
"rzSliderHigh"
===
this
.
tracking
&&
a
<=
this
.
scope
.
rzSliderModel
&&
(
this
.
scope
[
this
.
tracking
]
=
this
.
scope
.
rzSliderModel
,
this
.
updateHandles
(
this
.
tracking
,
this
.
minH
.
rzsl
),
this
.
tracking
=
"rzSliderModel"
,
this
.
maxH
.
removeClass
(
"rz-active"
),
this
.
minH
.
addClass
(
"rz-active"
),
this
.
scope
.
$apply
(),
this
.
callOnChange
())),
this
.
scope
[
this
.
tracking
]
!==
a
&&
(
this
.
scope
[
this
.
tracking
]
=
a
,
this
.
updateHandles
(
this
.
tracking
,
b
),
this
.
scope
.
$apply
(),
this
.
callOnChange
())},
onEnd
:
function
(
a
,
b
){
var
d
=
this
.
getEventNames
(
b
).
moveEvent
;
this
.
minH
.
removeClass
(
"rz-active"
),
this
.
maxH
.
removeClass
(
"rz-active"
),
c
.
off
(
d
,
a
),
this
.
scope
.
$emit
(
"slideEnded"
),
this
.
tracking
=
""
,
this
.
dragging
.
active
=!
1
,
this
.
callOnEnd
()},
getEventNames
:
function
(
a
){
var
b
=
{
moveEvent
:
""
,
endEvent
:
""
};
return
a
.
touches
||
void
0
!==
a
.
originalEvent
&&
a
.
originalEvent
.
touches
?(
b
.
moveEvent
=
"touchmove"
,
b
.
endEvent
=
"touchend"
):(
b
.
moveEvent
=
"mousemove"
,
b
.
endEvent
=
"mouseup"
),
b
}},
f
}]).
directive
(
"rzslider"
,[
"RzSlider"
,
function
(
a
){
return
{
restrict
:
"E"
,
scope
:{
rzSliderFloor
:
"=?"
,
rzSliderCeil
:
"=?"
,
rzSliderStep
:
"@"
,
rzSliderPrecision
:
"@"
,
rzSliderModel
:
"=?"
,
rzSliderHigh
:
"=?"
,
rzSliderDraggable
:
"@"
,
rzSliderTranslate
:
"&"
,
rzSliderHideLimitLabels
:
"=?"
,
rzSliderAlwaysShowBar
:
"=?"
,
rzSliderPresentOnly
:
"@"
,
rzSliderOnStart
:
"&"
,
rzSliderOnChange
:
"&"
,
rzSliderOnEnd
:
"&"
},
templateUrl
:
function
(
a
,
b
){
return
b
.
rzSliderTplUrl
||
"rzSliderTpl.html"
},
link
:
function
(
b
,
c
,
d
){
return
new
a
(
b
,
c
,
d
)}}}]);
return
b
.
run
([
"$templateCache"
,
function
(
a
){
a
.
put
(
"rzSliderTpl.html"
,
'<span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-selection"></span></span> <span class=rz-pointer></span> <span class=rz-pointer></span> <span class="rz-bubble rz-limit"></span> <span class="rz-bubble rz-limit"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span>'
)}]),
b
});
\ No newline at end of file
/*! jusas-angularjs-slider - v0.1.32 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-10-02 */
!
function
(
a
,
b
){
"use strict"
;
"function"
==
typeof
define
&&
define
.
amd
?
define
([
"angular"
],
b
):
"object"
==
typeof
module
&&
module
.
exports
?
module
.
exports
=
b
(
require
(
"angular"
)):
b
(
a
.
angular
)}(
this
,
function
(
a
){
"use strict"
;
var
b
=
a
.
module
(
"rzModule"
,[]).
value
(
"throttle"
,
function
(
a
,
b
,
c
){
var
d
,
e
,
f
,
g
=
Date
.
now
||
function
(){
return
(
new
Date
).
getTime
()},
h
=
null
,
i
=
0
;
c
=
c
||
{};
var
j
=
function
(){
i
=
c
.
leading
===!
1
?
0
:
g
(),
h
=
null
,
f
=
a
.
apply
(
d
,
e
),
d
=
e
=
null
};
return
function
(){
var
k
=
g
();
i
||
c
.
leading
!==!
1
||
(
i
=
k
);
var
l
=
b
-
(
k
-
i
);
return
d
=
this
,
e
=
arguments
,
0
>=
l
?(
clearTimeout
(
h
),
h
=
null
,
i
=
k
,
f
=
a
.
apply
(
d
,
e
),
d
=
e
=
null
):
h
||
c
.
trailing
===!
1
||
(
h
=
setTimeout
(
j
,
l
)),
f
}}).
factory
(
"RzSlider"
,[
"$timeout"
,
"$document"
,
"$window"
,
"throttle"
,
function
(
b
,
c
,
d
,
e
){
var
f
=
function
(
a
,
b
,
c
){
this
.
scope
=
a
,
this
.
attributes
=
c
,
this
.
sliderElem
=
b
,
this
.
range
=
void
0
!==
c
.
rzSliderHigh
&&
void
0
!==
c
.
rzSliderModel
,
this
.
dragRange
=
this
.
range
&&
"true"
===
c
.
rzSliderDraggableRange
,
this
.
dragging
=
{
active
:
!
1
,
value
:
0
,
difference
:
0
,
offset
:
0
,
lowDist
:
0
,
highDist
:
0
},
this
.
handleHalfWidth
=
0
,
this
.
alwaysShowBar
=!!
c
.
rzSliderAlwaysShowBar
,
this
.
maxLeft
=
0
,
this
.
precision
=
0
,
this
.
step
=
0
,
this
.
tracking
=
""
,
this
.
minValue
=
0
,
this
.
maxValue
=
0
,
this
.
hideLimitLabels
=!!
c
.
rzSliderHideLimitLabels
,
this
.
presentOnly
=
"true"
===
c
.
rzSliderPresentOnly
,
this
.
showTicks
=
"true"
===
c
.
rzSliderShowTicks
,
this
.
valueRange
=
0
,
this
.
initHasRun
=!
1
,
this
.
customTrFn
=
this
.
scope
.
rzSliderTranslate
()
||
function
(
a
){
return
String
(
a
)},
this
.
deRegFuncs
=
[],
this
.
fullBar
=
null
,
this
.
selBar
=
null
,
this
.
minH
=
null
,
this
.
maxH
=
null
,
this
.
flrLab
=
null
,
this
.
ceilLab
=
null
,
this
.
minLab
=
null
,
this
.
maxLab
=
null
,
this
.
cmbLab
=
null
,
this
.
ticks
=
null
,
this
.
init
()};
return
f
.
prototype
=
{
init
:
function
(){
var
c
,
f
,
g
,
h
=
a
.
bind
(
this
,
this
.
calcViewDimensions
),
i
=
this
;
this
.
initElemHandles
(),
this
.
calcViewDimensions
(),
this
.
setMinAndMax
(),
this
.
precision
=
void
0
===
this
.
scope
.
rzSliderPrecision
?
0
:
+
this
.
scope
.
rzSliderPrecision
,
this
.
step
=
void
0
===
this
.
scope
.
rzSliderStep
?
1
:
+
this
.
scope
.
rzSliderStep
,
b
(
function
(){
i
.
updateCeilLab
(),
i
.
updateFloorLab
(),
i
.
initHandles
(),
i
.
presentOnly
||
i
.
bindEvents
(),
i
.
showTicks
&&
i
.
updateTicksScale
()}),
g
=
this
.
scope
.
$on
(
"reCalcViewDimensions"
,
h
),
this
.
deRegFuncs
.
push
(
g
),
a
.
element
(
d
).
on
(
"resize"
,
h
),
this
.
initHasRun
=!
0
,
c
=
e
(
function
(){
i
.
setMinAndMax
(),
i
.
updateLowHandle
(
i
.
valueToOffset
(
i
.
scope
.
rzSliderModel
)),
i
.
updateSelectionBar
(),
i
.
range
&&
i
.
updateCmbLabel
()},
350
,{
leading
:
!
1
}),
f
=
e
(
function
(){
i
.
setMinAndMax
(),
i
.
updateHighHandle
(
i
.
valueToOffset
(
i
.
scope
.
rzSliderHigh
)),
i
.
updateSelectionBar
(),
i
.
updateCmbLabel
()},
350
,{
leading
:
!
1
}),
this
.
scope
.
$on
(
"rzSliderForceRender"
,
function
(){
i
.
resetLabelsValue
(),
c
(),
i
.
range
&&
f
(),
i
.
resetSlider
()}),
g
=
this
.
scope
.
$watch
(
"rzSliderModel"
,
function
(
a
,
b
){
a
!==
b
&&
c
()}),
this
.
deRegFuncs
.
push
(
g
),
g
=
this
.
scope
.
$watch
(
"rzSliderHigh"
,
function
(
a
,
b
){
a
!==
b
&&
f
()}),
this
.
deRegFuncs
.
push
(
g
),
this
.
scope
.
$watch
(
"rzSliderFloor"
,
function
(
a
,
b
){
a
!==
b
&&
i
.
resetSlider
()}),
this
.
deRegFuncs
.
push
(
g
),
g
=
this
.
scope
.
$watch
(
"rzSliderCeil"
,
function
(
a
,
b
){
a
!==
b
&&
i
.
resetSlider
()}),
this
.
deRegFuncs
.
push
(
g
),
this
.
scope
.
$on
(
"$destroy"
,
function
(){
i
.
minH
.
off
(),
i
.
maxH
.
off
(),
i
.
fullBar
.
off
(),
i
.
selBar
.
off
(),
i
.
ticks
.
off
(),
a
.
element
(
d
).
off
(
"resize"
,
h
),
i
.
deRegFuncs
.
map
(
function
(
a
){
a
()})})},
resetSlider
:
function
(){
this
.
setMinAndMax
(),
this
.
updateCeilLab
(),
this
.
updateFloorLab
(),
this
.
calcViewDimensions
()},
resetLabelsValue
:
function
(){
this
.
minLab
.
rzsv
=
void
0
,
this
.
maxLab
.
rzsv
=
void
0
},
initHandles
:
function
(){
this
.
updateLowHandle
(
this
.
valueToOffset
(
this
.
scope
.
rzSliderModel
)),
this
.
range
&&
(
this
.
updateHighHandle
(
this
.
valueToOffset
(
this
.
scope
.
rzSliderHigh
)),
this
.
updateCmbLabel
()),
this
.
updateSelectionBar
()},
translateFn
:
function
(
a
,
b
,
c
){
c
=
void
0
===
c
?
!
0
:
c
;
var
d
=
(
c
?
this
.
customTrFn
(
a
):
a
).
toString
(),
e
=!
1
;(
void
0
===
b
.
rzsv
||
b
.
rzsv
.
length
!==
d
.
length
||
b
.
rzsv
.
length
>
0
&&
0
===
b
.
rzsw
)
&&
(
e
=!
0
,
b
.
rzsv
=
d
),
b
.
text
(
d
),
e
&&
this
.
getWidth
(
b
)},
setMinAndMax
:
function
(){
this
.
scope
.
rzSliderFloor
?
this
.
minValue
=+
this
.
scope
.
rzSliderFloor
:
this
.
minValue
=
this
.
scope
.
rzSliderFloor
=
0
,
this
.
scope
.
rzSliderCeil
?
this
.
maxValue
=+
this
.
scope
.
rzSliderCeil
:
this
.
maxValue
=
this
.
scope
.
rzSliderCeil
=
this
.
range
?
this
.
scope
.
rzSliderHigh
:
this
.
scope
.
rzSliderModel
,
this
.
scope
.
rzSliderStep
&&
(
this
.
step
=+
this
.
scope
.
rzSliderStep
),
this
.
valueRange
=
this
.
maxValue
-
this
.
minValue
},
initElemHandles
:
function
(){
a
.
forEach
(
this
.
sliderElem
.
children
(),
function
(
b
,
c
){
var
d
=
a
.
element
(
b
);
switch
(
c
){
case
0
:
this
.
fullBar
=
d
;
break
;
case
1
:
this
.
selBar
=
d
;
break
;
case
2
:
this
.
minH
=
d
;
break
;
case
3
:
this
.
maxH
=
d
;
break
;
case
4
:
this
.
flrLab
=
d
;
break
;
case
5
:
this
.
ceilLab
=
d
;
break
;
case
6
:
this
.
minLab
=
d
;
break
;
case
7
:
this
.
maxLab
=
d
;
break
;
case
8
:
this
.
cmbLab
=
d
;
break
;
case
9
:
this
.
ticks
=
d
}},
this
),
this
.
selBar
.
rzsl
=
0
,
this
.
minH
.
rzsl
=
0
,
this
.
maxH
.
rzsl
=
0
,
this
.
flrLab
.
rzsl
=
0
,
this
.
ceilLab
.
rzsl
=
0
,
this
.
minLab
.
rzsl
=
0
,
this
.
maxLab
.
rzsl
=
0
,
this
.
cmbLab
.
rzsl
=
0
,
this
.
ticks
.
rzsl
=
0
,
this
.
hideLimitLabels
&&
(
this
.
flrLab
.
rzAlwaysHide
=!
0
,
this
.
ceilLab
.
rzAlwaysHide
=!
0
,
this
.
hideEl
(
this
.
flrLab
),
this
.
hideEl
(
this
.
ceilLab
)),
this
.
range
===!
1
&&
(
this
.
cmbLab
.
remove
(),
this
.
maxLab
.
remove
(),
this
.
maxH
.
rzAlwaysHide
=!
0
,
this
.
maxH
[
0
].
style
.
zIndex
=
"-1000"
,
this
.
hideEl
(
this
.
maxH
)),
this
.
range
===!
1
&&
this
.
alwaysShowBar
===!
1
&&
(
this
.
maxH
.
remove
(),
this
.
selBar
.
remove
()),
this
.
dragRange
&&
(
this
.
selBar
.
css
(
"cursor"
,
"move"
),
this
.
selBar
.
addClass
(
"rz-draggable"
))},
calcViewDimensions
:
function
(){
var
a
=
this
.
getWidth
(
this
.
minH
);
this
.
handleHalfWidth
=
a
/
2
,
this
.
barWidth
=
this
.
getWidth
(
this
.
fullBar
),
this
.
maxLeft
=
this
.
barWidth
-
a
,
this
.
getWidth
(
this
.
sliderElem
),
this
.
sliderElem
.
rzsl
=
this
.
sliderElem
[
0
].
getBoundingClientRect
().
left
,
this
.
showTicks
&&
this
.
updateTicksScale
(),
this
.
initHasRun
&&
(
this
.
updateCeilLab
(),
this
.
initHandles
())},
updateTicksScale
:
function
(){
for
(
var
a
=
""
,
b
=
this
.
minValue
;
b
<
this
.
maxValue
;
b
+=
this
.
step
)
a
+=
"<li></li>"
;
a
+=
"<li></li>"
,
this
.
ticks
.
html
(
a
),
this
.
ticks
.
css
({
width
:
this
.
barWidth
-
2
*
this
.
handleHalfWidth
+
"px"
,
left
:
this
.
handleHalfWidth
+
"px"
})},
updateCeilLab
:
function
(){
this
.
translateFn
(
this
.
scope
.
rzSliderCeil
,
this
.
ceilLab
),
this
.
setLeft
(
this
.
ceilLab
,
this
.
barWidth
-
this
.
ceilLab
.
rzsw
),
this
.
getWidth
(
this
.
ceilLab
)},
updateFloorLab
:
function
(){
this
.
translateFn
(
this
.
scope
.
rzSliderFloor
,
this
.
flrLab
),
this
.
getWidth
(
this
.
flrLab
)},
callOnStart
:
function
(){
if
(
this
.
scope
.
rzSliderOnStart
){
var
a
=
this
;
b
(
function
(){
a
.
scope
.
rzSliderOnStart
()})}},
callOnChange
:
function
(){
if
(
this
.
scope
.
rzSliderOnChange
){
var
a
=
this
;
b
(
function
(){
a
.
scope
.
rzSliderOnChange
()})}},
callOnEnd
:
function
(){
if
(
this
.
scope
.
rzSliderOnEnd
){
var
a
=
this
;
b
(
function
(){
a
.
scope
.
rzSliderOnEnd
()})}},
updateHandles
:
function
(
a
,
b
){
return
"rzSliderModel"
===
a
?(
this
.
updateLowHandle
(
b
),
this
.
updateSelectionBar
(),
void
(
this
.
range
&&
this
.
updateCmbLabel
())):
"rzSliderHigh"
===
a
?(
this
.
updateHighHandle
(
b
),
this
.
updateSelectionBar
(),
void
(
this
.
range
&&
this
.
updateCmbLabel
())):(
this
.
updateLowHandle
(
b
),
this
.
updateHighHandle
(
b
),
this
.
updateSelectionBar
(),
void
this
.
updateCmbLabel
())},
updateLowHandle
:
function
(
a
){
var
b
=
Math
.
abs
(
this
.
minH
.
rzsl
-
a
);
this
.
minLab
.
rzsv
&&
1
>
b
||
(
this
.
setLeft
(
this
.
minH
,
a
),
this
.
translateFn
(
this
.
scope
.
rzSliderModel
,
this
.
minLab
),
this
.
setLeft
(
this
.
minLab
,
a
-
this
.
minLab
.
rzsw
/
2
+
this
.
handleHalfWidth
),
this
.
shFloorCeil
())},
updateHighHandle
:
function
(
a
){
this
.
setLeft
(
this
.
maxH
,
a
),
this
.
translateFn
(
this
.
scope
.
rzSliderHigh
,
this
.
maxLab
),
this
.
setLeft
(
this
.
maxLab
,
a
-
this
.
maxLab
.
rzsw
/
2
+
this
.
handleHalfWidth
),
this
.
shFloorCeil
()},
shFloorCeil
:
function
(){
var
a
=!
1
,
b
=!
1
;
this
.
minLab
.
rzsl
<=
this
.
flrLab
.
rzsl
+
this
.
flrLab
.
rzsw
+
5
?(
a
=!
0
,
this
.
hideEl
(
this
.
flrLab
)):(
a
=!
1
,
this
.
showEl
(
this
.
flrLab
)),
this
.
minLab
.
rzsl
+
this
.
minLab
.
rzsw
>=
this
.
ceilLab
.
rzsl
-
this
.
handleHalfWidth
-
10
?(
b
=!
0
,
this
.
hideEl
(
this
.
ceilLab
)):(
b
=!
1
,
this
.
showEl
(
this
.
ceilLab
)),
this
.
range
&&
(
this
.
maxLab
.
rzsl
+
this
.
maxLab
.
rzsw
>=
this
.
ceilLab
.
rzsl
-
10
?
this
.
hideEl
(
this
.
ceilLab
):
b
||
this
.
showEl
(
this
.
ceilLab
),
this
.
maxLab
.
rzsl
<=
this
.
flrLab
.
rzsl
+
this
.
flrLab
.
rzsw
+
this
.
handleHalfWidth
?
this
.
hideEl
(
this
.
flrLab
):
a
||
this
.
showEl
(
this
.
flrLab
))},
updateSelectionBar
:
function
(){
this
.
setWidth
(
this
.
selBar
,
Math
.
abs
(
this
.
maxH
.
rzsl
-
this
.
minH
.
rzsl
)),
this
.
setLeft
(
this
.
selBar
,
this
.
range
?
this
.
minH
.
rzsl
+
this
.
handleHalfWidth
:
0
)},
updateCmbLabel
:
function
(){
var
a
,
b
;
this
.
minLab
.
rzsl
+
this
.
minLab
.
rzsw
+
10
>=
this
.
maxLab
.
rzsl
?(
this
.
customTrFn
?(
a
=
this
.
customTrFn
(
this
.
scope
.
rzSliderModel
),
b
=
this
.
customTrFn
(
this
.
scope
.
rzSliderHigh
)):(
a
=
this
.
scope
.
rzSliderModel
,
b
=
this
.
scope
.
rzSliderHigh
),
this
.
translateFn
(
a
+
" - "
+
b
,
this
.
cmbLab
,
!
1
),
this
.
setLeft
(
this
.
cmbLab
,
this
.
selBar
.
rzsl
+
this
.
selBar
.
rzsw
/
2
-
this
.
cmbLab
.
rzsw
/
2
),
this
.
hideEl
(
this
.
minLab
),
this
.
hideEl
(
this
.
maxLab
),
this
.
showEl
(
this
.
cmbLab
)):(
this
.
showEl
(
this
.
maxLab
),
this
.
showEl
(
this
.
minLab
),
this
.
hideEl
(
this
.
cmbLab
))},
roundStep
:
function
(
a
){
var
b
=
this
.
step
,
c
=+
((
a
-
this
.
minValue
)
%
b
).
toFixed
(
3
),
d
=
c
>
b
/
2
?
a
+
b
-
c
:
a
-
c
;
return
d
=
d
.
toFixed
(
this
.
precision
),
+
d
},
hideEl
:
function
(
a
){
return
a
.
css
({
opacity
:
0
})},
showEl
:
function
(
a
){
return
a
.
rzAlwaysHide
?
a
:
a
.
css
({
opacity
:
1
})},
setLeft
:
function
(
a
,
b
){
return
a
.
rzsl
=
b
,
a
.
css
({
left
:
b
+
"px"
}),
b
},
getWidth
:
function
(
a
){
var
b
=
a
[
0
].
getBoundingClientRect
();
return
a
.
rzsw
=
b
.
right
-
b
.
left
,
a
.
rzsw
},
setWidth
:
function
(
a
,
b
){
return
a
.
rzsw
=
b
,
a
.
css
({
width
:
b
+
"px"
}),
b
},
valueToOffset
:
function
(
a
){
return
(
a
-
this
.
minValue
)
*
this
.
maxLeft
/
this
.
valueRange
||
0
},
offsetToValue
:
function
(
a
){
return
a
/
this
.
maxLeft
*
this
.
valueRange
+
this
.
minValue
},
getEventX
:
function
(
a
){
return
"clientX"
in
a
?
a
.
clientX
:
void
0
===
a
.
originalEvent
?
a
.
touches
[
0
].
clientX
:
a
.
originalEvent
.
touches
[
0
].
clientX
},
getNearestHandle
:
function
(
a
){
if
(
!
this
.
range
)
return
this
.
minH
;
var
b
=
this
.
getEventX
(
a
)
-
this
.
sliderElem
.
rzsl
-
this
.
handleHalfWidth
;
return
Math
.
abs
(
b
-
this
.
minH
.
rzsl
)
<
Math
.
abs
(
b
-
this
.
maxH
.
rzsl
)?
this
.
minH
:
this
.
maxH
},
bindEvents
:
function
(){
var
b
,
c
,
d
;
this
.
dragRange
?(
b
=
"rzSliderDrag"
,
c
=
this
.
onDragStart
,
d
=
this
.
onDragMove
):(
b
=
"rzSliderModel"
,
c
=
this
.
onStart
,
d
=
this
.
onMove
),
this
.
minH
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
minH
,
"rzSliderModel"
)),
this
.
range
&&
this
.
maxH
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
maxH
,
"rzSliderHigh"
)),
this
.
fullBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
null
,
null
)),
this
.
fullBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
)),
this
.
selBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
c
,
null
,
b
)),
this
.
selBar
.
on
(
"mousedown"
,
a
.
bind
(
this
,
d
,
this
.
selBar
)),
this
.
ticks
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onStart
,
null
,
null
)),
this
.
ticks
.
on
(
"mousedown"
,
a
.
bind
(
this
,
this
.
onMove
,
this
.
ticks
)),
this
.
minH
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
minH
,
"rzSliderModel"
)),
this
.
range
&&
this
.
maxH
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
this
.
maxH
,
"rzSliderHigh"
)),
this
.
fullBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
null
,
null
)),
this
.
fullBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
)),
this
.
selBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
c
,
null
,
b
)),
this
.
selBar
.
on
(
"touchstart"
,
a
.
bind
(
this
,
d
,
this
.
selBar
)),
this
.
ticks
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onStart
,
null
,
null
)),
this
.
ticks
.
on
(
"touchstart"
,
a
.
bind
(
this
,
this
.
onMove
,
this
.
ticks
))},
onStart
:
function
(
b
,
d
,
e
){
var
f
,
g
,
h
=
this
.
getEventNames
(
e
);
e
.
stopPropagation
(),
e
.
preventDefault
(),
""
===
this
.
tracking
&&
(
this
.
calcViewDimensions
(),
b
?
this
.
tracking
=
d
:(
b
=
this
.
getNearestHandle
(
e
),
this
.
tracking
=
b
===
this
.
minH
?
"rzSliderModel"
:
"rzSliderHigh"
),
b
.
addClass
(
"rz-active"
),
f
=
a
.
bind
(
this
,
this
.
dragging
.
active
?
this
.
onDragMove
:
this
.
onMove
,
b
),
g
=
a
.
bind
(
this
,
this
.
onEnd
,
f
),
c
.
on
(
h
.
moveEvent
,
f
),
c
.
one
(
h
.
endEvent
,
g
),
this
.
callOnStart
())},
onMove
:
function
(
a
,
b
){
var
c
,
d
,
e
,
f
=
this
.
getEventX
(
b
);
if
(
c
=
this
.
sliderElem
.
rzsl
,
d
=
f
-
c
-
this
.
handleHalfWidth
,
0
>=
d
){
if
(
0
===
a
.
rzsl
)
return
;
e
=
this
.
minValue
,
d
=
0
}
else
if
(
d
>=
this
.
maxLeft
){
if
(
a
.
rzsl
===
this
.
maxLeft
)
return
;
e
=
this
.
maxValue
,
d
=
this
.
maxLeft
}
else
e
=
this
.
offsetToValue
(
d
),
e
=
this
.
roundStep
(
e
),
d
=
this
.
valueToOffset
(
e
);
this
.
positionTrackingHandle
(
e
,
d
)},
onDragStart
:
function
(
a
,
b
,
c
){
var
d
=
this
.
getEventX
(
c
)
-
this
.
sliderElem
.
rzsl
-
this
.
handleHalfWidth
;
this
.
dragging
=
{
active
:
!
0
,
value
:
this
.
offsetToValue
(
d
),
difference
:
this
.
scope
.
rzSliderHigh
-
this
.
scope
.
rzSliderModel
,
offset
:
d
,
lowDist
:
d
-
this
.
minH
.
rzsl
,
highDist
:
this
.
maxH
.
rzsl
-
d
},
this
.
minH
.
addClass
(
"rz-active"
),
this
.
maxH
.
addClass
(
"rz-active"
),
this
.
onStart
(
a
,
b
,
c
)},
onDragMove
:
function
(
a
,
b
){
var
c
,
d
,
e
,
f
,
g
=
this
.
getEventX
(
b
)
-
this
.
sliderElem
.
rzsl
-
this
.
handleHalfWidth
;
if
(
g
<=
this
.
dragging
.
lowDist
){
if
(
a
.
rzsl
===
this
.
dragging
.
lowDist
)
return
;
e
=
this
.
minValue
,
c
=
0
,
f
=
this
.
dragging
.
difference
,
d
=
this
.
valueToOffset
(
f
)}
else
if
(
g
>=
this
.
maxLeft
-
this
.
dragging
.
highDist
){
if
(
a
.
rzsl
===
this
.
dragging
.
highDist
)
return
;
f
=
this
.
maxValue
,
d
=
this
.
maxLeft
,
e
=
this
.
maxValue
-
this
.
dragging
.
difference
,
c
=
this
.
valueToOffset
(
e
)}
else
e
=
this
.
offsetToValue
(
g
-
this
.
dragging
.
lowDist
),
e
=
this
.
roundStep
(
e
),
c
=
this
.
valueToOffset
(
e
),
f
=
e
+
this
.
dragging
.
difference
,
d
=
this
.
valueToOffset
(
f
);
this
.
positionTrackingBar
(
e
,
f
,
c
,
d
)},
positionTrackingBar
:
function
(
a
,
b
,
c
,
d
){
this
.
scope
.
rzSliderModel
=
a
,
this
.
scope
.
rzSliderHigh
=
b
,
this
.
updateHandles
(
"rzSliderModel"
,
c
),
this
.
updateHandles
(
"rzSliderHigh"
,
d
),
this
.
scope
.
$apply
(),
this
.
callOnChange
()},
positionTrackingHandle
:
function
(
a
,
b
){
this
.
range
&&
(
"rzSliderModel"
===
this
.
tracking
&&
a
>=
this
.
scope
.
rzSliderHigh
?(
this
.
scope
[
this
.
tracking
]
=
this
.
scope
.
rzSliderHigh
,
this
.
updateHandles
(
this
.
tracking
,
this
.
maxH
.
rzsl
),
this
.
tracking
=
"rzSliderHigh"
,
this
.
minH
.
removeClass
(
"rz-active"
),
this
.
maxH
.
addClass
(
"rz-active"
),
this
.
scope
.
$apply
(),
this
.
callOnChange
()):
"rzSliderHigh"
===
this
.
tracking
&&
a
<=
this
.
scope
.
rzSliderModel
&&
(
this
.
scope
[
this
.
tracking
]
=
this
.
scope
.
rzSliderModel
,
this
.
updateHandles
(
this
.
tracking
,
this
.
minH
.
rzsl
),
this
.
tracking
=
"rzSliderModel"
,
this
.
maxH
.
removeClass
(
"rz-active"
),
this
.
minH
.
addClass
(
"rz-active"
),
this
.
scope
.
$apply
(),
this
.
callOnChange
())),
this
.
scope
[
this
.
tracking
]
!==
a
&&
(
this
.
scope
[
this
.
tracking
]
=
a
,
this
.
updateHandles
(
this
.
tracking
,
b
),
this
.
scope
.
$apply
(),
this
.
callOnChange
())},
onEnd
:
function
(
a
,
b
){
var
d
=
this
.
getEventNames
(
b
).
moveEvent
;
this
.
minH
.
removeClass
(
"rz-active"
),
this
.
maxH
.
removeClass
(
"rz-active"
),
c
.
off
(
d
,
a
),
this
.
scope
.
$emit
(
"slideEnded"
),
this
.
tracking
=
""
,
this
.
dragging
.
active
=!
1
,
this
.
callOnEnd
()},
getEventNames
:
function
(
a
){
var
b
=
{
moveEvent
:
""
,
endEvent
:
""
};
return
a
.
touches
||
void
0
!==
a
.
originalEvent
&&
a
.
originalEvent
.
touches
?(
b
.
moveEvent
=
"touchmove"
,
b
.
endEvent
=
"touchend"
):(
b
.
moveEvent
=
"mousemove"
,
b
.
endEvent
=
"mouseup"
),
b
}},
f
}]).
directive
(
"rzslider"
,[
"RzSlider"
,
function
(
a
){
return
{
restrict
:
"E"
,
scope
:{
rzSliderFloor
:
"=?"
,
rzSliderCeil
:
"=?"
,
rzSliderStep
:
"@"
,
rzSliderPrecision
:
"@"
,
rzSliderModel
:
"=?"
,
rzSliderHigh
:
"=?"
,
rzSliderDraggable
:
"@"
,
rzSliderTranslate
:
"&"
,
rzSliderHideLimitLabels
:
"=?"
,
rzSliderAlwaysShowBar
:
"=?"
,
rzSliderPresentOnly
:
"@"
,
rzSliderOnStart
:
"&"
,
rzSliderOnChange
:
"&"
,
rzSliderOnEnd
:
"&"
,
rzSliderShowTicks
:
"@"
},
templateUrl
:
function
(
a
,
b
){
return
b
.
rzSliderTplUrl
||
"rzSliderTpl.html"
},
link
:
function
(
b
,
c
,
d
){
return
new
a
(
b
,
c
,
d
)}}}]);
return
b
.
run
([
"$templateCache"
,
function
(
a
){
a
.
put
(
"rzSliderTpl.html"
,
'<span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-selection"></span></span> <span class=rz-pointer></span> <span class=rz-pointer></span> <span class="rz-bubble rz-limit"></span> <span class="rz-bubble rz-limit"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span><ul class=rz-ticks></ul>'
)}]),
b
});
\ No newline at end of file
src/rzSliderTpl.html
View file @
b7a01c58
...
...
@@ -6,4 +6,5 @@
<span
class=
"rz-bubble rz-limit"
></span>
<!-- // 5 Ceiling label -->
<span
class=
"rz-bubble"
></span>
<!-- // 6 Label above left slider handle -->
<span
class=
"rz-bubble"
></span>
<!-- // 7 Label above right slider handle -->
<span
class=
"rz-bubble"
></span>
<!-- // 8 Range label when the slider handles are close ex. 15 - 17 -->
\ No newline at end of file
<span
class=
"rz-bubble"
></span>
<!-- // 8 Range label when the slider handles are close ex. 15 - 17 -->
<ul
class=
"rz-ticks"
></ul>
<!-- // 9 The ticks -->
\ No newline at end of file
src/rzslider.js
View file @
b7a01c58
...
...
@@ -211,6 +211,13 @@ function throttle(func, wait, options) {
*/
this
.
presentOnly
=
attributes
.
rzSliderPresentOnly
===
'true'
;
/**
* Display ticks on each possible value.
*
* @type {boolean}
*/
this
.
showTicks
=
attributes
.
rzSliderShowTicks
===
'true'
;
/**
* The delta between min and max value
*
...
...
@@ -249,6 +256,7 @@ function throttle(func, wait, options) {
this
.
minLab
=
null
;
// Label above the low value
this
.
maxLab
=
null
;
// Label above the high value
this
.
cmbLab
=
null
;
// Combined label
this
.
ticks
=
null
;
// The ticks
// Initialize slider
this
.
init
();
...
...
@@ -281,6 +289,8 @@ function throttle(func, wait, options) {
self
.
updateFloorLab
();
self
.
initHandles
();
if
(
!
self
.
presentOnly
)
{
self
.
bindEvents
();
}
if
(
self
.
showTicks
)
self
.
updateTicksScale
();
});
// Recalculate slider view dimensions
...
...
@@ -359,6 +369,7 @@ function throttle(func, wait, options) {
self
.
maxH
.
off
();
self
.
fullBar
.
off
();
self
.
selBar
.
off
();
self
.
ticks
.
off
();
angular
.
element
(
$window
).
off
(
'resize'
,
calcDimFn
);
self
.
deRegFuncs
.
map
(
function
(
unbind
)
{
unbind
();
});
});
...
...
@@ -493,6 +504,7 @@ function throttle(func, wait, options) {
case
6
:
this
.
minLab
=
jElem
;
break
;
case
7
:
this
.
maxLab
=
jElem
;
break
;
case
8
:
this
.
cmbLab
=
jElem
;
break
;
case
9
:
this
.
ticks
=
jElem
;
break
;
}
},
this
);
...
...
@@ -506,6 +518,7 @@ function throttle(func, wait, options) {
this
.
minLab
.
rzsl
=
0
;
this
.
maxLab
.
rzsl
=
0
;
this
.
cmbLab
.
rzsl
=
0
;
this
.
ticks
.
rzsl
=
0
;
// Hide limit labels
if
(
this
.
hideLimitLabels
)
...
...
@@ -561,6 +574,8 @@ function throttle(func, wait, options) {
this
.
getWidth
(
this
.
sliderElem
);
this
.
sliderElem
.
rzsl
=
this
.
sliderElem
[
0
].
getBoundingClientRect
().
left
;
if
(
this
.
showTicks
)
this
.
updateTicksScale
();
if
(
this
.
initHasRun
)
{
...
...
@@ -569,6 +584,24 @@ function throttle(func, wait, options) {
}
},
/**
* Update the ticks position
*
* @returns {undefined}
*/
updateTicksScale
:
function
()
{
var
positions
=
''
;
for
(
var
i
=
this
.
minValue
;
i
<
this
.
maxValue
;
i
+=
this
.
step
)
{
positions
+=
'<li></li>'
;
}
positions
+=
'<li></li>'
;
this
.
ticks
.
html
(
positions
);
this
.
ticks
.
css
({
width
:
(
this
.
barWidth
-
2
*
this
.
handleHalfWidth
)
+
'px'
,
left
:
this
.
handleHalfWidth
+
'px'
});
},
/**
* Update position of the ceiling label
*
...
...
@@ -974,6 +1007,8 @@ function throttle(func, wait, options) {
this
.
fullBar
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
));
this
.
selBar
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
barStart
,
null
,
barTracking
));
this
.
selBar
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
barMove
,
this
.
selBar
));
this
.
ticks
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
this
.
onStart
,
null
,
null
));
this
.
ticks
.
on
(
'mousedown'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
ticks
));
this
.
minH
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onStart
,
this
.
minH
,
'rzSliderModel'
));
if
(
this
.
range
)
{
this
.
maxH
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onStart
,
this
.
maxH
,
'rzSliderHigh'
));
}
...
...
@@ -981,6 +1016,8 @@ function throttle(func, wait, options) {
this
.
fullBar
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
fullBar
));
this
.
selBar
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
barStart
,
null
,
barTracking
));
this
.
selBar
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
barMove
,
this
.
selBar
));
this
.
ticks
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onStart
,
null
,
null
));
this
.
ticks
.
on
(
'touchstart'
,
angular
.
bind
(
this
,
this
.
onMove
,
this
.
ticks
));
},
/**
...
...
@@ -1266,7 +1303,8 @@ function throttle(func, wait, options) {
rzSliderPresentOnly
:
'@'
,
rzSliderOnStart
:
'&'
,
rzSliderOnChange
:
'&'
,
rzSliderOnEnd
:
'&'
rzSliderOnEnd
:
'&'
,
rzSliderShowTicks
:
'@'
},
/**
...
...
src/rzslider.less
View file @
b7a01c58
...
...
@@ -22,6 +22,7 @@
@limitLabelTextColor: @labelTextColor;
@barFillColor: @handleBgColor;
@barNormalColor: #d8e0f3;
@ticksColor: #666;
/* Slider size parameters */
@handleSize: 32px;
...
...
@@ -57,19 +58,20 @@ rzslider span.rz-bar-wrapper {
padding-top: @handleSize / 2;
width: 100%;
height: @handleSize;
z-index: 1;
}
rzslider span.rz-bar {
left: 0;
width: 100%;
height: @barHeight;
z-index:
0
;
z-index:
1
;
background: @barNormalColor;
.rounded(@barHeight/2);
}
rzslider span.rz-bar.rz-selection {
z-index:
1
;
z-index:
2
;
background: @barFillColor;
.rounded(@barHeight/2);
}
...
...
@@ -80,7 +82,7 @@ rzslider span.rz-pointer {
height: @handleSize;
top: -@handleSize/2 + @barHeight/2;
background-color: @handleBgColor;
z-index:
2
;
z-index:
3
;
.rounded(@handleSize/2);
// -webkit-transition:all linear 0.15s;
// -moz-transition:all linear 0.15s;
...
...
@@ -121,3 +123,22 @@ rzslider span.rz-bubble.rz-selection {
rzslider span.rz-bubble.rz-limit {
color: @limitLabelTextColor;
}
rzslider .rz-ticks {
position: absolute;
padding: 0;
margin: 0;
z-index: 1;
list-style: none;
display: flex;
justify-content: space-between;
top: -3px;
li {
width: 10px;
height: 10px;
background: @ticksColor;
border-radius: 50%;
cursor: pointer;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment