Make WordPress Core

Changeset 63403


Ignore:
Timestamp:
08/30/2026 11:39:05 PM (22 hours ago)
Author:
peterwilsoncc
Message:

Docs: Document functions within embed-template.js.

See #65860.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/embed-template.js

    r63402 r63403  
    11/**
    22 * @output wp-includes/js/wp-embed-template.js
     3 */
     4
     5/**
     6 * IIFE setup function.
     7 *
     8 * @param {Window} window Global window object.
     9 * @param {Document} document Global document object.
    310 */
    411(function ( window, document ) {
     
    2633        }
    2734
     35        /**
     36         * Runs on DomContentLoaded and load event.
     37         *
     38         * Exits early on the load event if the earlier event has
     39         * successfully fired.
     40         */
    2841        function onLoad() {
    2942                if ( loaded ) {
     
    4861                }
    4962
     63                /**
     64                 * Open share dialog within embed iframe.
     65                 */
    5066                function openSharingDialog() {
    5167                        share_dialog.className = share_dialog.className.replace( 'hidden', '' );
     
    5470                }
    5571
     72                /**
     73                 * Close share dialog within embed iframe.
     74                 */
    5675                function closeSharingDialog() {
    5776                        share_dialog.className += ' hidden';
     
    7190                }
    7291
     92                /**
     93                 * Click event handler for share button.
     94                 *
     95                 * @param {MouseEvent} event Event handler.
     96                 */
    7397                function shareClickHandler( event ) {
    7498                        var currentTab = document.querySelector( '.wp-embed-share-tab-button [aria-selected="true"]' );
     
    80104                }
    81105
     106                /**
     107                 * Keyboard event handler for share button.
     108                 *
     109                 * @param {KeyboardEvent} event Event handler.
     110                 * @return {boolean|void} Returns false if default action is to be prevented.
     111                 */
    82112                function shareKeyHandler( event ) {
    83113                        var target = event.target,
     
    128158                }, false );
    129159
     160                /**
     161                 * Constrain tabbing to share dialog when open.
     162                 *
     163                 * @param {KeyboardEvent} event Event object.
     164                 */
    130165                function constrainTabbing( event ) {
    131166                        // Need to re-get the selected tab each time.
Note: See TracChangeset for help on using the changeset viewer.