jquery.tipsy: Remove support for 'live' option
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 25 Jul 2016 11:37:45 +0000 (13:37 +0200)
committerKrinkle <krinklemail@gmail.com>
Sat, 17 Dec 2016 01:33:21 +0000 (01:33 +0000)
Follows-up aa524075ac from 2014.

It was relying on jQuery features that have been deprecated a long time
ago, officially removed in jQuery 1.11, and removed for real in 3.0.
We have to get rid of it at some point. As far as I can tell, nothing
in our repositories uses this option anymore.

Rather than remove the code and diverge further from upstream Tipsy,
I'm just making it throw an error if this is passed. Maybe one day we'll
upgrade Tipsy too to some modern version and this will then disappear.

Bug: T85048
Change-Id: I7dca8334556b1079cd4fee2e6e921232fe3d46ef

resources/src/jquery.tipsy/jquery.tipsy.js

index 2c6a588..ddda432 100644 (file)
             }
         };
 
-        if (!options.live) this.each(function() { get(this); });
+        this.each(function() { get(this); });
 
         if ( options.trigger != 'manual' ) {
             var eventIn  = options.trigger == 'hover' ? 'mouseenter focus' : 'focus',
                 eventOut = options.trigger == 'hover' ? 'mouseleave blur' : 'blur';
             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 );
+                mw.log.warn( 'Use of the "live" option of jquery.tipsy is no longer supported.' );
             }
+            this
+                .on( eventIn, enter )
+                .on( eventOut, leave );
         }
 
         return this;