From: Chris Oyler Date: Sat, 6 Feb 2016 00:06:07 +0000 (-0800) Subject: fixes merge conflicts and cleans up dual var declaration X-Git-Tag: v6.2.0-rc.1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8089%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fixes merge conflicts and cleans up dual var declaration --- diff --git a/js/foundation.slider.js b/js/foundation.slider.js index e5babd2e0..af1e62c77 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -9,7 +9,7 @@ * @requires foundation.util.touch */ -export default class Slider { +export default class Slider { /** * Creates a new instance of a drilldown menu. * @class @@ -139,11 +139,11 @@ export default class Slider { //number of actual pixels to shift the handle, based on the percentage obtained above pxToMove = (elemDim - handleDim) * pctOfBar, //percentage of bar to shift the handle - movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal), + movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal); //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value - location = parseFloat(location.toFixed(this.options.decimal)), + location = parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders - css = {}; + var css = {}; this._setValues($hndl, location); @@ -264,14 +264,12 @@ export default class Slider { barXY = barOffset > 0 ? -halfOfHandle : (barOffset - halfOfHandle) < -barDim ? barDim : Math.abs(barOffset), offsetPct = percent(barXY, barDim); value = (this.options.end - this.options.start) * offsetPct; -// FIX ME WEE WOO WEE WOO -// <<<<<<< HEAD - value = _this._adjustValue(null, value); -// ======= + // turn everything around for RTL, yay math! if (Foundation.rtl() && !this.options.vertical) {value = this.options.end - value;} + + value = _this._adjustValue(null, value); //boolean flag for the setHandlePos fn, specifically for vertical sliders -// >>>>>>> develop hasVal = false; if (!$handle) {//figure out which handle it is, pass it to the next function. @@ -334,28 +332,19 @@ export default class Slider { _this._handleEvent(e, _this.handles.eq(idx), $(this).val()); }); - if (this.options.clickSelect) { - this.$element.off('click.zf.slider').on('click.zf.slider', function(e) { - if (_this.$element.data('dragging')) { return false; } -// <<<<<<< HEAD - _this.animComplete = false; - - if (!$(e.target).is('[data-slider-handle]')) { - if (_this.options.doubleSided) { - _this._handleEvent(e); - } else { - _this._handleEvent(e, _this.$handle); - } -// ======= + if (this.options.clickSelect) { + this.$element.off('click.zf.slider').on('click.zf.slider', function(e) { + if (_this.$element.data('dragging')) { return false; } - if (_this.options.doubleSided) { - _this._handleEvent(e); - } else { - _this._handleEvent(e, _this.$handle); -// >>>>>>> develop - } - }}); - } + if (!$(e.target).is('[data-slider-handle]')) { + if (_this.options.doubleSided) { + _this._handleEvent(e); + } else { + _this._handleEvent(e, _this.$handle); + } + } + }); + } if (this.options.draggable) { this.handles.addTouch(); @@ -386,7 +375,7 @@ export default class Slider { }); }); } - + $handle.off('keydown.zf.slider').on('keydown.zf.slider', function(e) { var _$handle = $(this), idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0, @@ -561,4 +550,4 @@ if (window.Foundation) { // counter++; // } // cb(); -// }; \ No newline at end of file +// };