]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
changes to tooltip default behavior 8730/head
authorCorey Snyder <corey@tangerineindustries.com>
Tue, 3 May 2016 18:52:40 +0000 (14:52 -0400)
committerCorey Snyder <corey@tangerineindustries.com>
Tue, 3 May 2016 18:52:40 +0000 (14:52 -0400)
js/foundation.tooltip.js

index 1998979f08e8687c792028f2520762801d8eec93..02fbd54612a0b03aa6b82f9d65e1c2a9369aab44 100644 (file)
@@ -40,7 +40,7 @@ class Tooltip {
     this.template = this.options.template ? $(this.options.template) : this._buildTemplate(elemId);
 
     this.template.appendTo(document.body)
-        .html(this.options.tipText)
+        .text(this.options.tipText)
         .hide();
 
     this.$element.attr({
@@ -248,28 +248,10 @@ class Tooltip {
         }
       })
       .on('mouseleave.zf.tooltip', function(e) {
-               if (_this.options.tipHoverable) {
-                       _this.timeout = setTimeout(function () {
-                               clearTimeout(_this.timeout);
-                               if ($template.is(":hover")) {
-                                 $template.on('mouseleave', function (e) {
-                                        if (!isFocus || !_this.isClick && _this.options.clickOpen) {
-                                               _this.hide();
-                                        }
-                                        $template.off('mouseleave');
-                                 });
-                               } else {
-                                       if (!isFocus || !_this.isClick && _this.options.clickOpen) {
-                                         _this.hide();
-                                       }
-                               }
-                       }, 200); //min required to capture
-               } else {
-                       clearTimeout(_this.timeout);
-                       if (!isFocus || !_this.isClick && _this.options.clickOpen) {
-                         _this.hide();
-                       }
-               }
+        clearTimeout(_this.timeout);
+        if (!isFocus || (_this.isClick && !_this.options.clickOpen)) {
+          _this.hide();
+        }
       });
     }
 
@@ -449,13 +431,7 @@ Tooltip.defaults = {
    * @option
    * @example 12
    */
-  hOffset: 12,
-  /**
-        * Should the tip remain open if hover
-        * @option
-        * @example false
-        */
-        tipHoverable: false
+  hOffset: 12
 };
 
 /**
@@ -465,4 +441,4 @@ Tooltip.defaults = {
 // Window exports
 Foundation.plugin(Tooltip, 'Tooltip');
 
-}(jQuery);
+}(jQuery);
\ No newline at end of file