From 2301074821d3565e8e37c28d6edc4f505d8c7e01 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 28 Feb 2013 18:05:28 +0000 Subject: [PATCH] Stop using deprecated jQuery API (.browser and .live). Do manual UA sniffing where still necessary. Improve selector performance by using delegated events. props ocean90. see #22975. git-svn-id: http://core.svn.wordpress.org/trunk@23518 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/plugin-install.js | 2 +- wp-includes/js/admin-bar.js | 10 ++++++---- wp-includes/js/autosave.js | 3 ++- wp-includes/js/thickbox/thickbox.js | 8 +++----- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/wp-admin/js/plugin-install.js b/wp-admin/js/plugin-install.js index f32574abdb..26e9982e28 100644 --- a/wp-admin/js/plugin-install.js +++ b/wp-admin/js/plugin-install.js @@ -27,7 +27,7 @@ jQuery(document).ready(function($) { $(window).resize(function(){ tb_position(); }); - $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() { + $('#dashboard_plugins, .plugins').on( 'click', 'a.thickbox', function() { tb_click.call(this); $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); diff --git a/wp-includes/js/admin-bar.js b/wp-includes/js/admin-bar.js index cb4e118491..71b8d5e78a 100644 --- a/wp-includes/js/admin-bar.js +++ b/wp-includes/js/admin-bar.js @@ -1,8 +1,9 @@ // use jQuery and hoverIntent if loaded if ( typeof(jQuery) != 'undefined' ) { - if ( typeof(jQuery.fn.hoverIntent) == 'undefined' ) - (function(a){a.fn.hoverIntent=function(l,j){var m={sensitivity:7,interval:100,timeout:0};m=a.extend(m,j?{over:l,out:j}:l);var o,n,h,d;var e=function(f){o=f.pageX;n=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-o)+Math.abs(d-n))