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
a20704a9
Commit
a20704a9
authored
May 23, 2015
by
Rafal Zajac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style clean up
parent
55d19feb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
rzslider.min.js
dist/rzslider.min.js
+1
-1
rzslider.js
rzslider.js
+26
-26
No files found.
dist/rzslider.min.js
View file @
a20704a9
This diff is collapsed.
Click to expand it.
rzslider.js
View file @
a20704a9
...
...
@@ -57,7 +57,7 @@ function throttle(func, wait, options) {
}
})
.
factory
(
'RzSlider'
,
[
'$timeout'
,
'$document'
,
'
throttle'
,
function
(
$timeout
,
$document
,
throttle
)
.
factory
(
'RzSlider'
,
[
'$timeout'
,
'$document'
,
'
$window'
,
'throttle'
,
function
(
$timeout
,
$document
,
$window
,
throttle
)
{
/**
* Slider
...
...
@@ -93,7 +93,7 @@ function throttle(func, wait, options) {
/**
* Slider type
*
* @type {
string}
* @type {
boolean} Set to true for range slider
*/
this
.
range
=
attributes
.
rzSliderHigh
!==
undefined
&&
attributes
.
rzSliderModel
!==
undefined
;
...
...
@@ -107,9 +107,9 @@ function throttle(func, wait, options) {
/**
* Always show selection bar
*
* @type {
string|
boolean}
* @type {boolean}
*/
this
.
alwaysShowBar
=
attributes
.
rzSliderAlwaysShowBar
||
false
;
this
.
alwaysShowBar
=
!!
attributes
.
rzSliderAlwaysShowBar
;
/**
* Maximum left the slider handle can have
...
...
@@ -158,7 +158,7 @@ function throttle(func, wait, options) {
*
* @type {boolean}
*/
this
.
hideLimitLabels
=
!!
attributes
.
rzSliderHideLimitLabels
||
false
;
this
.
hideLimitLabels
=
!!
attributes
.
rzSliderHideLimitLabels
;
/**
* The delta between min and max value
...
...
@@ -172,14 +172,16 @@ function throttle(func, wait, options) {
*
* @type {boolean}
*/
this
.
initRun
=
false
;
this
.
init
Has
Run
=
false
;
/**
* Custom translate function
*
* @type {function}
*/
this
.
customTrFn
=
null
;
this
.
customTrFn
=
this
.
scope
.
rzSliderTranslate
()
||
function
(
value
)
{
return
''
+
value
;
};
this
.
unbinders
=
[];
// Slider DOM elements wrapped in jqLite
this
.
fullBar
=
null
;
// The whole slider bar
...
...
@@ -208,17 +210,10 @@ function throttle(func, wait, options) {
{
var
self
=
this
;
this
.
unbinders
=
[];
if
(
this
.
scope
.
rzSliderTranslate
)
{
this
.
customTrFn
=
this
.
scope
.
rzSliderTranslate
();
}
this
.
initElemHandles
();
this
.
calcViewDimensions
();
this
.
setMinAndMax
();
this
.
precision
=
this
.
scope
.
rzSliderPrecision
===
undefined
?
0
:
+
this
.
scope
.
rzSliderPrecision
;
this
.
step
=
this
.
scope
.
rzSliderStep
===
undefined
?
1
:
+
this
.
scope
.
rzSliderStep
;
...
...
@@ -234,9 +229,9 @@ function throttle(func, wait, options) {
this
.
scope
.
$on
(
'reCalcViewDimensions'
,
angular
.
bind
(
this
,
this
.
calcViewDimensions
));
// Recalculate stuff if view port dimensions have changed
angular
.
element
(
window
).
on
(
'resize'
,
angular
.
bind
(
this
,
this
.
calcViewDimensions
));
angular
.
element
(
$
window
).
on
(
'resize'
,
angular
.
bind
(
this
,
this
.
calcViewDimensions
));
this
.
initRun
=
true
;
this
.
init
Has
Run
=
true
;
// Watch for changes to the model
...
...
@@ -300,7 +295,7 @@ function throttle(func, wait, options) {
self
.
minH
.
off
(
'.rzslider'
);
self
.
maxH
.
off
(
'.rzslider'
);
$document
.
off
(
'.rzslider'
);
angular
.
element
(
window
).
off
(
'.rzslider'
);
angular
.
element
(
$
window
).
off
(
'.rzslider'
);
});
this
.
scope
.
$on
(
'$destroy'
,
function
()
...
...
@@ -368,7 +363,7 @@ function throttle(func, wait, options) {
{
useCustomTr
=
useCustomTr
===
undefined
?
true
:
useCustomTr
;
var
valStr
=
this
.
customTrFn
&&
useCustomTr
?
''
+
this
.
customTrFn
(
value
)
:
''
+
value
,
var
valStr
=
useCustomTr
?
''
+
this
.
customTrFn
(
value
)
:
''
+
value
,
getWidth
=
false
;
if
(
label
.
rzsv
===
undefined
||
label
.
rzsv
.
length
!=
valStr
.
length
||
(
label
.
rzsv
.
length
>
0
&&
label
.
rzsw
==
0
))
...
...
@@ -425,6 +420,7 @@ function throttle(func, wait, options) {
*/
initElemHandles
:
function
()
{
// Assign all slider elements to object properties for easy access
angular
.
forEach
(
this
.
sliderElem
.
children
(),
function
(
elem
,
index
)
{
var
_elem
=
angular
.
element
(
elem
);
...
...
@@ -444,7 +440,7 @@ function throttle(func, wait, options) {
},
this
);
// Initialize offsets
// Initialize offset
cache propertie
s
this
.
fullBar
.
rzsl
=
0
;
this
.
selBar
.
rzsl
=
0
;
this
.
minH
.
rzsl
=
0
;
...
...
@@ -455,6 +451,7 @@ function throttle(func, wait, options) {
this
.
maxLab
.
rzsl
=
0
;
this
.
cmbLab
.
rzsl
=
0
;
// Hide limit labels
if
(
this
.
hideLimitLabels
)
{
this
.
flrLab
.
rzAlwaysHide
=
true
;
...
...
@@ -464,15 +461,18 @@ function throttle(func, wait, options) {
}
// Remove stuff not needed in single slider
if
(
!
this
.
rang
e
)
if
(
this
.
range
===
fals
e
)
{
this
.
cmbLab
.
remove
();
this
.
maxLab
.
remove
();
// Hide max handle
this
.
maxH
.
rzAlwaysHide
=
true
;
this
.
hideEl
(
this
.
maxH
);
}
if
(
!
this
.
range
&&
!
this
.
alwaysShowBar
)
// Show selection bar for single slider or not
if
(
this
.
range
===
false
&&
this
.
alwaysShowBar
===
false
)
{
this
.
maxH
.
remove
();
this
.
selBar
.
remove
();
...
...
@@ -498,7 +498,7 @@ function throttle(func, wait, options) {
this
.
getWidth
(
this
.
sliderElem
);
this
.
sliderElem
.
rzsl
=
this
.
sliderElem
[
0
].
getBoundingClientRect
().
left
;
if
(
this
.
initRun
)
if
(
this
.
init
Has
Run
)
{
this
.
updateCeilLab
();
this
.
initHandles
();
...
...
@@ -879,7 +879,7 @@ function throttle(func, wait, options) {
{
this
.
scope
[
this
.
tracking
]
=
this
.
minValue
;
this
.
updateHandles
(
this
.
tracking
,
0
);
this
.
scope
.
$apply
();
//
this.scope.$apply();
}
return
;
...
...
@@ -891,7 +891,7 @@ function throttle(func, wait, options) {
{
this
.
scope
[
this
.
tracking
]
=
this
.
maxValue
;
this
.
updateHandles
(
this
.
tracking
,
this
.
maxLeft
);
this
.
scope
.
$apply
();
//
this.scope.$apply();
}
return
;
...
...
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