From: Daniel Ruf Date: Sat, 5 Oct 2019 15:45:37 +0000 (+0200) Subject: refactor: remove some unused code X-Git-Tag: v6.6.2^2~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9a98edbfab032c1d8a820d506fb20d639f21fb8;p=thirdparty%2Ffoundation%2Ffoundation-sites.git refactor: remove some unused code --- diff --git a/js/foundation.accordionMenu.js b/js/foundation.accordionMenu.js index 9169af8c2..dbd3a1fc7 100644 --- a/js/foundation.accordionMenu.js +++ b/js/foundation.accordionMenu.js @@ -93,7 +93,6 @@ class AccordionMenu extends Plugin { }); var initPanes = this.$element.find('.is-active'); if(initPanes.length){ - var _this = this; initPanes.each(function(){ _this.down($(this)); }); diff --git a/js/foundation.core.utils.js b/js/foundation.core.utils.js index b6778b72b..bce3f8ed1 100644 --- a/js/foundation.core.utils.js +++ b/js/foundation.core.utils.js @@ -53,8 +53,8 @@ function transitionend($elem){ } if(end){ return end; - }else{ - end = setTimeout(function(){ + } else { + setTimeout(function(){ $elem.triggerHandler('transitionend', [$elem]); }, 1); return 'transitionend'; diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index d2e6696f7..441efd40f 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -83,12 +83,7 @@ class Magellan extends Plugin { * @private */ _events() { - var _this = this, - $body = $('html, body'), - opts = { - duration: _this.options.animationDuration, - easing: _this.options.animationEasing - }; + var _this = this; $(window).one('load', function(){ if(_this.options.deepLinking){ diff --git a/js/foundation.slider.js b/js/foundation.slider.js index bc340fbba..cd1f9e992 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -73,8 +73,7 @@ class Slider extends Plugin { this.$input = this.inputs.length ? this.inputs.eq(0) : $(`#${this.$handle.attr('aria-controls')}`); this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0); - var isDbl = false, - _this = this; + var _this = this; if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) { this.options.disabled = true; this.$element.addClass(this.options.disabledClass); @@ -94,7 +93,6 @@ class Slider extends Plugin { if (!this.inputs[1]) { this.inputs = this.inputs.add(this.$input2); } - isDbl = true; // this.$handle.triggerHandler('click.zf.slider'); this._setInitAttr(1); @@ -366,11 +364,9 @@ class Slider extends Plugin { param = vertical ? 'height' : 'width', direction = vertical ? 'top' : 'left', eventOffset = vertical ? e.pageY : e.pageX, - halfOfHandle = this.$handle[0].getBoundingClientRect()[param] / 2, barDim = this.$element[0].getBoundingClientRect()[param], windowScroll = vertical ? $(window).scrollTop() : $(window).scrollLeft(); - var elemOffset = this.$element.offset()[direction]; // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates... @@ -463,8 +459,7 @@ class Slider extends Plugin { */ _eventsForHandle($handle) { var _this = this, - curHandle, - timer; + curHandle; const handleChangeEvent = function(e) { const idx = _this.inputs.index($(this)); diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index 3ae09866b..029bf8f11 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -274,7 +274,6 @@ class Sticky extends Plugin { css = {}, anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight, mrgn = stickToTop ? 'marginTop' : 'marginBottom', - notStuckTo = stickToTop ? 'bottom' : 'top', topOrBottom = isTop ? 'top' : 'bottom'; css[mrgn] = 0; diff --git a/js/foundation.util.box.js b/js/foundation.util.box.js index 11688c358..f48c5ed06 100644 --- a/js/foundation.util.box.js +++ b/js/foundation.util.box.js @@ -1,8 +1,5 @@ 'use strict'; - -import { rtl as Rtl } from "./foundation.core.utils"; - var Box = { ImNotTouchingYou: ImNotTouchingYou, OverlapArea: OverlapArea,