From 54543366671df983f271f93b6c15fd59d6d7dbb1 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 5 Dec 2013 23:13:22 +0000 Subject: [PATCH] Widgets: jshint cleanup of widgets.js, see #25821. git-svn-id: https://develop.svn.wordpress.org/trunk@26703 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/widgets.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/js/widgets.js b/src/wp-admin/js/widgets.js index e1db0615c2..c1fd1f086c 100644 --- a/src/wp-admin/js/widgets.js +++ b/src/wp-admin/js/widgets.js @@ -403,7 +403,7 @@ wpWidgets = { }, addWidget: function( chooser ) { - var widget, widgetId, add, n, + var widget, widgetId, add, n, viewportTop, viewportBottom, sidebarBounds, sidebarId = chooser.find( '.widgets-chooser-selected' ).data('sidebarId'), sidebar = $( '#' + sidebarId ); @@ -447,15 +447,15 @@ wpWidgets = { * We do this by comparing the top and bottom, of the sidebar so see if they are within * the bounds of the viewport. */ - var viewport_top = $(window).scrollTop(), - viewport_bottom = viewport_top + $(window).height(), - sidebar_bounds = sidebar.offset(); + viewportTop = $(window).scrollTop(); + viewportBottom = viewportTop + $(window).height(); + sidebarBounds = sidebar.offset(); - sidebar_bounds.bottom = sidebar_bounds.top + sidebar.outerHeight(); + sidebarBounds.bottom = sidebarBounds.top + sidebar.outerHeight(); - if ( viewport_top > sidebar_bounds.bottom || viewport_bottom < sidebar_bounds.top ) { + if ( viewportTop > sidebarBounds.bottom || viewportBottom < sidebarBounds.top ) { $( 'html, body' ).animate({ - scrollTop: sidebar.offset().top - 130 + scrollTop: sidebarBounds.top - 130 }, 200 ); }