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
0873e9c0
Commit
0873e9c0
authored
Mar 16, 2016
by
Valentin Hervieu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(draggableRangeOnly): Fix the floor limit when floor is different than 0
Closes #293
parent
228c2687
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
15 deletions
+41
-15
rzslider.js
dist/rzslider.js
+3
-5
rzslider.min.js
dist/rzslider.min.js
+2
-2
rzslider.js
src/rzslider.js
+2
-4
draggableOnly-range-slider-horizontal-test.js
...se-controls/draggableOnly-range-slider-horizontal-test.js
+34
-4
No files found.
dist/rzslider.js
View file @
0873e9c0
/*! angularjs-slider - v2.10.3 -
(c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervieu.me>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com> -
https://github.com/angular-slider/angularjs-slider -
2016-03-1
4
*/
2016-03-1
6
*/
/*jslint unparam: true */
/*global angular: false, console: false, define, module */
(
function
(
root
,
factory
)
{
...
...
@@ -1594,9 +1594,9 @@
if
(
type
===
'min'
)
{
if
(
outOfBounds
)
{
if
(
isAbove
)
{
value
=
isRTL
?
v
alue
:
this
.
maxValue
-
this
.
dragging
.
difference
;
value
=
isRTL
?
this
.
minV
alue
:
this
.
maxValue
-
this
.
dragging
.
difference
;
}
else
{
value
=
isRTL
?
this
.
maxValue
-
this
.
dragging
.
difference
:
v
alue
;
value
=
isRTL
?
this
.
maxValue
-
this
.
dragging
.
difference
:
this
.
minV
alue
;
}
}
else
{
value
=
isRTL
?
this
.
offsetToValue
(
newOffset
+
this
.
dragging
.
lowLimit
)
:
this
.
offsetToValue
(
newOffset
-
this
.
dragging
.
lowLimit
)
...
...
@@ -1617,8 +1617,6 @@
}
}
return
this
.
roundStep
(
value
);
},
/**
...
...
dist/rzslider.min.js
View file @
0873e9c0
This diff is collapsed.
Click to expand it.
src/rzslider.js
View file @
0873e9c0
...
...
@@ -1598,9 +1598,9 @@
if
(
type
===
'min'
)
{
if
(
outOfBounds
)
{
if
(
isAbove
)
{
value
=
isRTL
?
v
alue
:
this
.
maxValue
-
this
.
dragging
.
difference
;
value
=
isRTL
?
this
.
minV
alue
:
this
.
maxValue
-
this
.
dragging
.
difference
;
}
else
{
value
=
isRTL
?
this
.
maxValue
-
this
.
dragging
.
difference
:
v
alue
;
value
=
isRTL
?
this
.
maxValue
-
this
.
dragging
.
difference
:
this
.
minV
alue
;
}
}
else
{
value
=
isRTL
?
this
.
offsetToValue
(
newOffset
+
this
.
dragging
.
lowLimit
)
:
this
.
offsetToValue
(
newOffset
-
this
.
dragging
.
lowLimit
)
...
...
@@ -1621,8 +1621,6 @@
}
}
return
this
.
roundStep
(
value
);
},
/**
...
...
tests/specs/mouse-controls/draggableOnly-range-slider-horizontal-test.js
View file @
0873e9c0
...
...
@@ -100,7 +100,7 @@
helper
.
slider
.
callOnChange
.
called
.
should
.
be
.
true
;
});
it
(
'should handle click on selbar and move
move
range when near 0 and moved left'
,
function
()
{
it
(
'should handle click on selbar and move range when near 0 and moved left'
,
function
()
{
helper
.
scope
.
slider
.
min
=
10
;
helper
.
scope
.
$digest
();
...
...
@@ -124,7 +124,7 @@
expect
(
helper
.
slider
.
tracking
).
to
.
equal
(
'rzSliderModel'
);
});
it
(
'should handle click on selbar and move
move
range when near max and moved right'
,
function
()
{
it
(
'should handle click on selbar and move range when near max and moved right'
,
function
()
{
helper
.
scope
.
slider
.
max
=
90
;
helper
.
scope
.
$digest
();
...
...
@@ -147,6 +147,21 @@
expect
(
helper
.
scope
.
slider
.
max
).
to
.
equal
(
100
);
expect
(
helper
.
slider
.
tracking
).
to
.
equal
(
'rzSliderModel'
);
});
it
(
'should handle click on selbar and move range when floor is not 0 and handle is dragged below limit'
,
function
()
{
helper
.
scope
.
slider
.
min
=
1050
;
helper
.
scope
.
slider
.
max
=
1550
;
helper
.
scope
.
slider
.
options
.
floor
=
1000
;
helper
.
scope
.
slider
.
options
.
ceil
=
5000
;
helper
.
scope
.
$digest
();
helper
.
fireMousedown
(
helper
.
slider
.
selBar
,
0
);
helper
.
fireMousemove
(
-
1000
);
expect
(
helper
.
scope
.
slider
.
min
).
to
.
equal
(
1000
);
expect
(
helper
.
scope
.
slider
.
max
).
to
.
equal
(
1500
);
expect
(
helper
.
slider
.
tracking
).
to
.
equal
(
'rzSliderModel'
);
});
});
describe
(
'Right to left Mouse controls - draggableRangeOnly Horizontal'
,
function
()
{
...
...
@@ -249,7 +264,7 @@
helper
.
slider
.
callOnChange
.
called
.
should
.
be
.
true
;
});
it
(
'should handle click on selbar and move
move
range when near 0 and moved left'
,
function
()
{
it
(
'should handle click on selbar and move range when near 0 and moved left'
,
function
()
{
helper
.
scope
.
slider
.
min
=
10
;
helper
.
scope
.
$digest
();
...
...
@@ -273,7 +288,7 @@
expect
(
helper
.
slider
.
tracking
).
to
.
equal
(
'rzSliderModel'
);
});
it
(
'should handle click on selbar and move
move
range when near max and moved right'
,
function
()
{
it
(
'should handle click on selbar and move range when near max and moved right'
,
function
()
{
helper
.
scope
.
slider
.
max
=
90
;
helper
.
scope
.
$digest
();
...
...
@@ -296,6 +311,21 @@
expect
(
helper
.
scope
.
slider
.
max
).
to
.
equal
(
100
);
expect
(
helper
.
slider
.
tracking
).
to
.
equal
(
'rzSliderModel'
);
});
it
(
'should handle click on selbar and move range when floor is not 0 and handle is dragged below limit'
,
function
()
{
helper
.
scope
.
slider
.
min
=
1050
;
helper
.
scope
.
slider
.
max
=
1550
;
helper
.
scope
.
slider
.
options
.
floor
=
1000
;
helper
.
scope
.
slider
.
options
.
ceil
=
5000
;
helper
.
scope
.
$digest
();
helper
.
fireMousedown
(
helper
.
slider
.
selBar
,
0
);
helper
.
fireMousemove
(
-
1000
);
expect
(
helper
.
scope
.
slider
.
min
).
to
.
equal
(
1000
);
expect
(
helper
.
scope
.
slider
.
max
).
to
.
equal
(
1500
);
expect
(
helper
.
slider
.
tracking
).
to
.
equal
(
'rzSliderModel'
);
});
});
}());
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