Make WordPress Core

Changeset 26703


Ignore:
Timestamp:
12/05/2013 11:13:22 PM (11 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/widgets.js

    r26696 r26703  
    404404
    405405    addWidget: function( chooser ) {
    406         var widget, widgetId, add, n,
     406        var widget, widgetId, add, n, viewportTop, viewportBottom, sidebarBounds,
    407407            sidebarId = chooser.find( '.widgets-chooser-selected' ).data('sidebarId'),
    408408            sidebar = $( '#' + sidebarId );
     
    448448         * the bounds of the viewport.
    449449         */
    450         var viewport_top = $(window).scrollTop(),
    451             viewport_bottom = viewport_top + $(window).height(),
    452             sidebar_bounds = sidebar.offset();
     450        viewportTop = $(window).scrollTop();
     451        viewportBottom = viewportTop + $(window).height();
     452        sidebarBounds = sidebar.offset();
    453453       
    454         sidebar_bounds.bottom = sidebar_bounds.top + sidebar.outerHeight();
    455 
    456         if ( viewport_top > sidebar_bounds.bottom || viewport_bottom < sidebar_bounds.top ) {
     454        sidebarBounds.bottom = sidebarBounds.top + sidebar.outerHeight();
     455
     456        if ( viewportTop > sidebarBounds.bottom || viewportBottom < sidebarBounds.top ) {
    457457            $( 'html, body' ).animate({
    458                 scrollTop: sidebar.offset().top - 130
     458                scrollTop: sidebarBounds.top - 130
    459459            }, 200 );
    460460        }
Note: See TracChangeset for help on using the changeset viewer.