diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /resources/src/jquery.tipsy/jquery.tipsy.js | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'resources/src/jquery.tipsy/jquery.tipsy.js')
-rw-r--r-- | resources/src/jquery.tipsy/jquery.tipsy.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/resources/src/jquery.tipsy/jquery.tipsy.js b/resources/src/jquery.tipsy/jquery.tipsy.js index 58a99a59..2a37fa86 100644 --- a/resources/src/jquery.tipsy/jquery.tipsy.js +++ b/resources/src/jquery.tipsy/jquery.tipsy.js @@ -6,7 +6,7 @@ // * This installation of tipsy includes several local modifications to both Javascript and CSS. // Please be careful when upgrading. -(function($) { +( function ( mw, $ ) { function maybeCall(thing, ctx) { return (typeof thing == 'function') ? (thing.call(ctx)) : thing; @@ -182,11 +182,22 @@ if (!options.live) this.each(function() { get(this); }); - if (options.trigger != 'manual') { - var binder = options.live ? 'live' : 'bind', - eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', + if ( options.trigger != 'manual' ) { + var eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; - this[binder](eventIn, enter)[binder](eventOut, leave); + if ( options.live ) { + mw.track( 'mw.deprecate', 'tipsy-live' ); + mw.log.warn( 'Use of the "live" option of jquery.tipsy is deprecated.' ); + // XXX: The official status of 'context' is deprecated, and the official status of + // 'selector' is removed, so this really needs to go. + $( this.context ) + .on( eventIn, this.selector, enter ) + .on( eventOut, this.selector, leave ); + } else { + this + .on( eventIn, enter ) + .on( eventOut, leave ); + } } return this; @@ -256,4 +267,4 @@ } }; -})(jQuery); +}( mediaWiki, jQuery ) ); |