Current Path : /storage/v11800/athomenoha/public_html/wp-content/plugins/salon-booking-system/js/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/athomenoha/public_html/wp-content/plugins/salon-booking-system/js/jquery.ui.slider.dragRange.js |
(function( $, undefined ) {
$.widget("ui.dragslider", $.ui.slider, {
options: $.extend({},$.ui.slider.prototype.options,{rangeDrag:false, rangeDragStep: $.ui.slider.prototype.options.step}),
_create: function() {
this._step = this.options.step;
this.options.step = this.options.rangeDragStep;
$.ui.slider.prototype._create.apply(this,arguments);
this._rangeCapture = false;
},
_mouseCapture: function( event ) {
var o = this.options;
if ( o.disabled ) return false;
if(event.target == this.range.get(0) && o.rangeDrag == true && o.range == true) {
this._rangeCapture = true;
this._rangeStart = null;
o.step = o.rangeDragStep;
}
else {
o.step = this._step;
this._rangeCapture = false;
}
$.ui.slider.prototype._mouseCapture.apply(this,arguments);
if(this._rangeCapture == true) {
this.handles.removeClass("ui-state-active").blur();
}
return true;
},
_mouseStop: function( event ) {
this.options.step = this._step;
this._rangeStart = null;
return $.ui.slider.prototype._mouseStop.apply(this,arguments);
},
_slide: function( event, index, newVal ) {
if(!this._rangeCapture) {
return $.ui.slider.prototype._slide.apply(this,arguments);
}
if(this._rangeStart == null) {
this._rangeStart = newVal;
}
var oldValLeft = this.options.values[0],
oldValRight = this.options.values[1],
slideDist = newVal - this._rangeStart,
newValueLeft = oldValLeft + slideDist,
newValueRight = oldValRight + slideDist,
allowed;
if ( this.options.values && this.options.values.length ) {
if(newValueRight > this._valueMax() && slideDist > 0) {
slideDist -= (newValueRight-this._valueMax());
newValueLeft = oldValLeft + slideDist;
newValueRight = oldValRight + slideDist;
}
if(newValueLeft < this._valueMin()) {
slideDist += (this._valueMin()-newValueLeft);
newValueLeft = oldValLeft + slideDist;
newValueRight = oldValRight + slideDist;
}
if ( slideDist != 0 ) {
newValues = this.values();
newValues[ 0 ] = newValueLeft;
newValues[ 1 ] = newValueRight;
// A slide can be canceled by returning false from the slide callback
allowed = this._trigger( "slide", event, {
handle: this.handles[ index ],
value: slideDist,
values: newValues
} );
if ( allowed !== false ) {
this.values( 0, newValueLeft, true );
this.values( 1, newValueRight, true );
}
this._rangeStart = newVal;
}
}
},
/*
//only for testing purpose
value: function(input) {
console.log("this is working!");
$.ui.slider.prototype.value.apply(this,arguments);
}
*/
});
})(jQuery);