Commit 07f9f27b authored by Rafal Zajac's avatar Rafal Zajac

- Fix minimum off window drag

- Potentially fix this.maxH.rzsl returning NaN
parent 86a85d3f
/*! jusas-angularjs-slider - v0.1.12 - (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-05-22 */ /*! jusas-angularjs-slider - v0.1.12 - (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-05-23 */
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{z-index:0;width:100%;height:100%;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.rz-bar.rz-selection{z-index:1;width:0;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} 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{z-index:0;width:100%;height:100%;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.rz-bar.rz-selection{z-index:1;width:0;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
This diff is collapsed.
...@@ -295,15 +295,18 @@ function throttle(func, wait, options) { ...@@ -295,15 +295,18 @@ function throttle(func, wait, options) {
self.resetSlider(); self.resetSlider();
})); }));
this.sliderElem.on('$destroy', function() { this.sliderElem.on('$destroy', function()
{
self.minH.off('.rzslider'); self.minH.off('.rzslider');
self.maxH.off('.rzslider'); self.maxH.off('.rzslider');
$document.off('.rzslider'); $document.off('.rzslider');
angular.element(window).off('.rzslider'); angular.element(window).off('.rzslider');
}); });
this.scope.$on('$destroy', function() { this.scope.$on('$destroy', function()
self.unbinders.map(function(unbind) { {
self.unbinders.map(function(unbind)
{
unbind(); unbind();
}); });
}); });
...@@ -465,11 +468,13 @@ function throttle(func, wait, options) { ...@@ -465,11 +468,13 @@ function throttle(func, wait, options) {
{ {
this.cmbLab.remove(); this.cmbLab.remove();
this.maxLab.remove(); this.maxLab.remove();
this.maxH.remove(); this.maxH.rzAlwaysHide = true;
this.hideEl(this.maxH);
} }
if( !this.range && !this.alwaysShowBar) if( !this.range && !this.alwaysShowBar)
{ {
this.maxH.remove();
this.selBar.remove(); this.selBar.remove();
} }
}, },
...@@ -854,10 +859,19 @@ function throttle(func, wait, options) { ...@@ -854,10 +859,19 @@ function throttle(func, wait, options) {
*/ */
onMove: function (pointer, event) onMove: function (pointer, event)
{ {
var eventX = event.clientX || (typeof(event.originalEvent) != 'undefined' ? event.originalEvent.touches[0].clientX : event.touches[0].clientX), var eventX, sliderLO, newOffset, newValue;
sliderLO = this.sliderElem.rzsl,
newOffset = eventX - sliderLO - this.handleHalfWidth, if('clientX' in event)
newValue; {
eventX = event.clientX;
}
else
{
eventX = typeof event.originalEvent !== 'undefined' ? event.originalEvent.touches[0].clientX : event.touches[0].clientX;
}
sliderLO = this.sliderElem.rzsl;
newOffset = eventX - sliderLO - this.handleHalfWidth;
if(newOffset <= 0) if(newOffset <= 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment