[ Index ]

WordPress 5.4.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/wp-includes/js/ -> admin-bar.js (summary)

(no description)

File Size: 464 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 12 functions

  removeHoverIfEscape()
  toggleHoverIfEnter()
  focusTargetAfterEnter()
  mobileHover()
  clickShortlink()
  emptySessionStorage()
  hasClass()
  addClass()
  removeClass()
  removeAllHoverClass()
  scrollToTop()
  getClosest()

Functions
Functions that are not part of a class:

removeHoverIfEscape( event )   X-Ref
Remove hover class for top level menu item when escape is pressed.

param: {Event} event The keydown event.

toggleHoverIfEnter( event )   X-Ref
Toggle hover class for top level menu item when enter is pressed.

param: {Event} event The keydown event.

focusTargetAfterEnter( event )   X-Ref
Focus the target of skip link after pressing Enter.

param: {Event} event The keydown event.

mobileHover( topMenuItems, event )   X-Ref
Toogle hover class for mobile devices.

param: {NodeList} topMenuItems All menu items.
param: {Event} event The click event.

clickShortlink( event )   X-Ref
Handles the click on the Shortlink link in the adminbar.

param: {Event} event The click event.
return: {boolean} Returns false to prevent default click behavior.

emptySessionStorage()   X-Ref
Clear sessionStorage on logging out.


hasClass( element, className )   X-Ref
Check if element has class.

param: {HTMLElement} element The HTML element.
param: {String}      className The class name.
return: {bool} Whether the element has the className.

addClass( element, className )   X-Ref
Add class to an element.

param: {HTMLElement} element The HTML element.
param: {String}      className The class name.

removeClass( element, className )   X-Ref
Remove class from an element.

param: {HTMLElement} element The HTML element.
param: {String}      className The class name.

removeAllHoverClass( topMenuItems )   X-Ref
Remove hover class for all menu items.

param: {NodeList} topMenuItems All menu items.

scrollToTop( event )   X-Ref
Scrolls to the top of the page.

param: {Event} event The Click event.
return: {void}

getClosest( el, selector )   X-Ref
Get closest Element.

param: {HTMLElement} el Element to get parent.
param: {string} selector CSS selector to match.



Generated: Tue May 19 15:51:04 2020 Cross-referenced by PHPXref 0.7.1