Note that there are some explanatory texts on larger screens.

plurals
  1. POCan someone comment on my bug fix?
    primarykey
    data
    text
    <p>I have been using <a href="http://twitter.github.com/bootstrap/javascript.html#tooltips" rel="nofollow">Twitter's Bootstrap Tooltip plugin</a>. This works perfectly fine except that when used on <code>svg</code> elements, it breaks. After some debugging, I narrowed down the problem. In the <code>js</code> file, the <code>init</code> function looks like this:</p> <pre><code> , init: function (type, element, options) { var eventIn , eventOut ... if (this.options.trigger != 'manual') { eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this)) } ... } </code></pre> <p>I remembered there were numerous issues with SVG-IE 9.0 specific implementation so I made the following modifications:</p> <pre><code> if (this.options.trigger != 'manual') { eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' var flag = $.browser.msie &amp;&amp; parseInt($.browser.version, 10) === 9 eventIn = flag ? "mouseover" : eventIn eventOut = flag ? "mouseout" : eventOut this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this)) } </code></pre> <p>And this works fine in all browsers. After some searching, I found that <a href="http://forum.jquery.com/topic/1-6-2-broke-svg-hover-events#14737000002851960" rel="nofollow">someone else</a> faced the same problem. I am not sure if there is a better way of fixing this bug especially after reading the argument in the <a href="http://forum.jquery.com/topic/1-6-2-broke-svg-hover-events#14737000002851960" rel="nofollow">link</a>. </p> <blockquote> <p>In IE9, there is a native contains() implementation on the document, so jQuery uses it. The problem is that this contains() implementation does not extend to SVG elements.</p> </blockquote> <p>Any suggestions on whether my fix can be improved?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload