WordPress.org

Make WordPress Core

Changeset 46440


Ignore:
Timestamp:
10/08/2019 05:18:07 PM (6 weeks ago)
Author:
afercia
Message:

Accessibility: Script Loader: Add jQuery as dependency of admin-bar.

On the front end, themes that don't use jQuery make the admin bar fallback to the non-jQuery implementation. Some important features miss from the non-jQuery admin-bar.js part, for example hoverintent and, most importantly, the touch events for the mobile menu don't work at all.

Enqueueing jQuery is the simplest option for now. For the future, a complete rewriting of admin-bar.js in plain JavaScript is highly recommended.

See #47069.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r46436 r46440  
    14911491    $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 );
    14921492
    1493     $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
     1493    $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array( 'jquery' ), false, 1 );
    14941494
    14951495    $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.