-
-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(labels): Refactor autoHiding algorithm for labels
fix #446
- Loading branch information
Showing
11 changed files
with
74 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "angularjs-slider", | ||
"version": "5.8.3", | ||
"version": "5.8.4", | ||
"homepage": "https://github.com/angular-slider/angularjs-slider", | ||
"authors": [ | ||
"Rafal Zajac <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! angularjs-slider - v5.8.3 - | ||
/*! angularjs-slider - v5.8.4 - | ||
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> - | ||
https://github.com/angular-slider/angularjs-slider - | ||
2016-11-03 */ | ||
2016-11-05 */ | ||
.rzslider { | ||
position: relative; | ||
display: inline-block; | ||
|
@@ -237,16 +237,6 @@ | |
left: 16px !important; | ||
} | ||
|
||
.rzslider.rz-vertical .rz-bubble.rz-floor { | ||
bottom: 0; | ||
left: auto; | ||
} | ||
|
||
.rzslider.rz-vertical .rz-bubble.rz-ceil { | ||
top: 0; | ||
right: auto; | ||
} | ||
|
||
.rzslider.rz-vertical .rz-ticks { | ||
top: 0; | ||
left: -3px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! angularjs-slider - v5.8.3 - | ||
/*! angularjs-slider - v5.8.4 - | ||
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> - | ||
https://github.com/angular-slider/angularjs-slider - | ||
2016-11-03 */ | ||
2016-11-05 */ | ||
/*jslint unparam: true */ | ||
/*global angular: false, console: false, define, module */ | ||
(function(root, factory) { | ||
|
@@ -1161,24 +1161,11 @@ | |
} | ||
var flHidden = false, | ||
clHidden = false, | ||
isRTL = this.options.rightToLeft, | ||
flrLabPos = this.flrLab.rzsp, | ||
flrLabDim = this.flrLab.rzsd, | ||
minLabPos = this.minLab.rzsp, | ||
minLabDim = this.minLab.rzsd, | ||
maxLabPos = this.maxLab.rzsp, | ||
maxLabDim = this.maxLab.rzsd, | ||
cmbLabPos = this.cmbLab.rzsp, | ||
cmbLabDim = this.cmbLab.rzsd, | ||
ceilLabPos = this.ceilLab.rzsp, | ||
halfHandle = this.handleHalfDim, | ||
isMinLabAtFloor = isRTL ? minLabPos + minLabDim >= flrLabPos - flrLabDim - 5 : minLabPos <= flrLabPos + flrLabDim + 5, | ||
isMinLabAtCeil = isRTL ? minLabPos - minLabDim <= ceilLabPos + halfHandle + 10 : minLabPos + minLabDim >= ceilLabPos - halfHandle - 10, | ||
isMaxLabAtFloor = isRTL ? maxLabPos >= flrLabPos - flrLabDim - halfHandle : maxLabPos <= flrLabPos + flrLabDim + halfHandle, | ||
isMaxLabAtCeil = isRTL ? maxLabPos - maxLabDim <= ceilLabPos + 10 : maxLabPos + maxLabDim >= ceilLabPos - 10, | ||
isCmbLabAtFloor = isRTL ? cmbLabPos >= flrLabPos - flrLabDim - halfHandle : cmbLabPos <= flrLabPos + flrLabDim + halfHandle, | ||
isCmbLabAtCeil = isRTL ? cmbLabPos - cmbLabDim <= ceilLabPos + 10 : cmbLabPos + cmbLabDim >= ceilLabPos - 10 | ||
|
||
isMinLabAtFloor = this.isLabelBelowFloorLab(this.minLab), | ||
isMinLabAtCeil = this.isLabelAboveCeilLab(this.minLab), | ||
isMaxLabAtCeil = this.isLabelAboveCeilLab(this.maxLab), | ||
isCmbLabAtFloor = this.isLabelBelowFloorLab(this.cmbLab), | ||
isCmbLabAtCeil = this.isLabelAboveCeilLab(this.cmbLab); | ||
|
||
if (isMinLabAtFloor) { | ||
flHidden = true; | ||
|
@@ -1215,6 +1202,28 @@ | |
} | ||
}, | ||
|
||
isLabelBelowFloorLab: function(label) { | ||
var isRTL = this.options.rightToLeft, | ||
pos = label.rzsp, | ||
dim = label.rzsd, | ||
floorPos = this.flrLab.rzsp, | ||
floorDim = this.flrLab.rzsd; | ||
return isRTL ? | ||
pos + dim >= floorPos - 2 : | ||
pos <= floorPos + floorDim + 2; | ||
}, | ||
|
||
isLabelAboveCeilLab: function(label) { | ||
var isRTL = this.options.rightToLeft, | ||
pos = label.rzsp, | ||
dim = label.rzsd, | ||
ceilPos = this.ceilLab.rzsp, | ||
ceilDim = this.ceilLab.rzsd; | ||
return isRTL ? | ||
pos <= ceilPos + ceilDim + 2 : | ||
pos + dim >= ceilPos - 2; | ||
}, | ||
|
||
/** | ||
* Update slider selection bar, combined label and range label | ||
* | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! angularjs-slider - v5.8.3 - | ||
/*! angularjs-slider - v5.8.4 - | ||
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> - | ||
https://github.com/angular-slider/angularjs-slider - | ||
2016-11-03 */ | ||
2016-11-05 */ | ||
.rzslider { | ||
position: relative; | ||
display: inline-block; | ||
|
@@ -237,16 +237,6 @@ | |
left: 16px !important; | ||
} | ||
|
||
.rzslider.rz-vertical .rz-bubble.rz-floor { | ||
bottom: 0; | ||
left: auto; | ||
} | ||
|
||
.rzslider.rz-vertical .rz-bubble.rz-ceil { | ||
top: 0; | ||
right: auto; | ||
} | ||
|
||
.rzslider.rz-vertical .rz-ticks { | ||
top: 0; | ||
left: -3px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters