Widgets: jshint cleanup of widgets.js, see #25821.

Built from https://develop.svn.wordpress.org/trunk@26703


git-svn-id: http://core.svn.wordpress.org/trunk@26593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2013-12-05 23:14:09 +00:00
parent e7f80a8fad
commit 765b617a8c
2 changed files with 8 additions and 8 deletions

View File

@ -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 );
}

File diff suppressed because one or more lines are too long