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
0fa7b2a0
Commit
0fa7b2a0
authored
May 22, 2015
by
Rafal Zajac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to latest version
parent
719e2165
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
14 deletions
+32
-14
demo.css
demo.css
+2
-1
index.html
index.html
+5
-4
rzslider.js
rzslider.js
+25
-9
No files found.
demo.css
View file @
0fa7b2a0
...
...
@@ -3,4 +3,5 @@ body { font-family: 'Open Sans', sans-serif; color: #1f2636; font-size: 14px; }
header
{
background
:
#0db9f0
;
color
:
#fff
;
margin
:
-40px
;
margin-bottom
:
40px
;
text-align
:
center
;
padding
:
40px
0
;
}
h1
{
font-weight
:
300
;
}
.wrapper
{
background
:
#fff
;
padding
:
40px
;
}
article
{
margin-bottom
:
40px
;
}
\ No newline at end of file
article
{
margin-bottom
:
40px
;
}
index.html
View file @
0fa7b2a0
...
...
@@ -33,7 +33,7 @@
</article>
<article>
<h2>
One value
slider example
</h2>
<h2>
Currency
slider example
</h2>
Value: {{ priceSlider2 | json }}
<rzslider
...
...
@@ -44,12 +44,13 @@
</article>
<article>
<h2>
Currency
slider example
</h2>
<h2>
One value
slider example
</h2>
Value: {{ priceSlider
2
| json }}
Value: {{ priceSlider
3
| json }}
<rzslider
rz-slider-model=
"priceSlider3"
rz-slider-floor=
"50"
rz-slider-ceil=
"450"
></rzslider>
rz-slider-ceil=
"450"
rz-slider-always-show-bar=
"true"
></rzslider>
</article>
<article>
...
...
rzslider.js
View file @
0fa7b2a0
...
...
@@ -4,7 +4,7 @@
* (c) Rafal Zajac <rzajac@gmail.com>
* http://github.com/rzajac/angularjs-slider
*
* Version: v0.1.1
1
* Version: v0.1.1
2
*
* Licensed under the MIT license
*/
...
...
@@ -31,7 +31,7 @@ function throttle(func, wait, options) {
var
context
,
args
,
result
;
var
timeout
=
null
;
var
previous
=
0
;
options
||
(
options
=
{})
;
options
=
options
||
{}
;
var
later
=
function
()
{
previous
=
options
.
leading
===
false
?
0
:
getTime
();
timeout
=
null
;
...
...
@@ -104,6 +104,13 @@ function throttle(func, wait, options) {
*/
this
.
handleHalfWidth
=
0
;
/**
* Always show selection bar
*
* @type {string|boolean}
*/
this
.
alwaysShowBar
=
attributes
.
rzSliderAlwaysShowBar
||
false
;
/**
* Maximum left the slider handle can have
*
...
...
@@ -237,10 +244,10 @@ function throttle(func, wait, options) {
{
self
.
setMinAndMax
();
self
.
updateLowHandle
(
self
.
valueToOffset
(
self
.
scope
.
rzSliderModel
));
self
.
updateSelectionBar
();
if
(
self
.
range
)
{
self
.
updateSelectionBar
();
self
.
updateCmbLabel
();
}
...
...
@@ -340,9 +347,10 @@ function throttle(func, wait, options) {
if
(
this
.
range
)
{
this
.
updateHighHandle
(
this
.
valueToOffset
(
this
.
scope
.
rzSliderHigh
));
this
.
updateSelectionBar
();
this
.
updateCmbLabel
();
}
this
.
updateSelectionBar
();
},
/**
...
...
@@ -453,6 +461,10 @@ function throttle(func, wait, options) {
this
.
cmbLab
.
remove
();
this
.
maxLab
.
remove
();
this
.
maxH
.
remove
();
}
if
(
!
this
.
range
&&
!
this
.
alwaysShowBar
)
{
this
.
selBar
.
remove
();
}
},
...
...
@@ -517,9 +529,10 @@ function throttle(func, wait, options) {
if
(
which
===
'rzSliderModel'
)
{
this
.
updateLowHandle
(
newOffset
);
this
.
updateSelectionBar
();
if
(
this
.
range
)
{
this
.
updateSelectionBar
();
this
.
updateCmbLabel
();
}
return
;
...
...
@@ -528,9 +541,10 @@ function throttle(func, wait, options) {
if
(
which
===
'rzSliderHigh'
)
{
this
.
updateHighHandle
(
newOffset
);
this
.
updateSelectionBar
();
if
(
this
.
range
)
{
this
.
updateSelectionBar
();
this
.
updateCmbLabel
();
}
return
;
...
...
@@ -634,8 +648,8 @@ function throttle(func, wait, options) {
*/
updateSelectionBar
:
function
()
{
this
.
setWidth
(
this
.
selBar
,
this
.
maxH
.
rzsl
-
this
.
minH
.
rzsl
);
this
.
setLeft
(
this
.
selBar
,
this
.
minH
.
rzsl
+
this
.
handleHalfWidth
);
this
.
setWidth
(
this
.
selBar
,
Math
.
abs
(
this
.
maxH
.
rzsl
-
this
.
minH
.
rzsl
)
);
this
.
setLeft
(
this
.
selBar
,
this
.
range
?
this
.
minH
.
rzsl
+
this
.
handleHalfWidth
:
0
);
},
/**
...
...
@@ -938,7 +952,8 @@ function throttle(func, wait, options) {
rzSliderModel
:
'=?'
,
rzSliderHigh
:
'=?'
,
rzSliderTranslate
:
'&'
,
rzSliderHideLimitLabels
:
'=?'
rzSliderHideLimitLabels
:
'=?'
,
rzSliderAlwaysShowBar
:
'=?'
},
template
:
'<span class="rz-bar"></span>'
+
// 0 The slider bar
'<span class="rz-bar rz-selection"></span>'
+
// 1 Highlight between two handles
...
...
@@ -980,6 +995,7 @@ function throttle(func, wait, options) {
/**
* @name Event
* @property {Array} touches
* @property {Event} originalEvent
*/
/**
...
...
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