From: Daniel Ruf Date: Sat, 5 Oct 2019 15:50:51 +0000 (+0200) Subject: fix: correctly use the elementClassName X-Git-Tag: v6.6.2^2~36^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11828%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: correctly use the elementClassName --- diff --git a/js/foundation.tooltip.js b/js/foundation.tooltip.js index 1d12ab391..1547a6e1a 100644 --- a/js/foundation.tooltip.js +++ b/js/foundation.tooltip.js @@ -73,14 +73,12 @@ class Tooltip extends Positionable { _getDefaultPosition() { // handle legacy classnames - var position = this.$element[0].className.match(/\b(top|left|right|bottom)\b/g); var elementClassName = this.$element[0].className; if (this.$element[0] instanceof SVGElement) { elementClassName = elementClassName.baseVal; } + var position = elementClassName.match(/\b(top|left|right|bottom)\b/g); return position ? position[0] : 'top'; - var position = elementClassName.match(/\b(top|left|right)\b/g); - position = position ? position[0] : 'tp'; } _getDefaultAlignment() {