]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: correctly use the elementClassName 11828/head
authorDaniel Ruf <mac1@daniel-ruf.de>
Sat, 5 Oct 2019 15:50:51 +0000 (17:50 +0200)
committerDaniel Ruf <mac1@daniel-ruf.de>
Sat, 5 Oct 2019 15:50:51 +0000 (17:50 +0200)
js/foundation.tooltip.js

index 1d12ab391d19c07deabccd05a3d85dfb981dbc8b..1547a6e1a76bd7803b9764bfa798470ad68ed3d4 100644 (file)
@@ -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() {