Make WordPress Core

Changeset 41314


Ignore:
Timestamp:
08/24/2017 05:57:18 PM (8 years ago)
Author:
wonderboymusic
Message:

Docs: improve JS docs for comment-reply.js

Props andizer, ireneyoast.
Fixes #41548.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/comment-reply.js

    r35675 r41314  
     1/**
     2 * @summary Handles the addition of the comment form.
     3 *
     4 * @since 2.7.0
     5 *
     6 * @type {Object}
     7 */
    18var addComment = {
     9    /**
     10     * @summary Retrieves the elements corresponding to the given IDs.
     11     *
     12     * @since 2.7.0
     13     *
     14     * @param {string} commId The comment ID.
     15     * @param {string} parentId The parent ID.
     16     * @param {string} respondId The respond ID.
     17     * @param {string} postId The post ID.
     18     * @returns {boolean} Always returns false.
     19     */
    220    moveForm: function( commId, parentId, respondId, postId ) {
    321        var div, element, style, cssHidden,
     
    3149        cancel.style.display = '';
    3250
     51        /**
     52         * @summary Puts back the comment, hides the cancel button and removes the onclick event.
     53         *
     54         * @returns {boolean} Always returns false.
     55         */
    3356        cancel.onclick = function() {
    3457            var t       = addComment,
     
    4972
    5073        /*
    51          * Set initial focus to the first form focusable element.
    52          * Try/catch used just to avoid errors in IE 7- which return visibility
     74         * Sets initial focus to the first form focusable element.
     75         * Uses try/catch just to avoid errors in IE 7- which return visibility
    5376         * 'inherit' when the visibility value is inherited from an ancestor.
    5477         */
     
    91114    },
    92115
     116    /**
     117     * @summary Returns the object corresponding to the given ID.
     118     *
     119     * @since 2.7.0
     120     *
     121     * @param {string} id The ID.
     122     * @returns {Element} The element belonging to the ID.
     123     */
    93124    I: function( id ) {
    94125        return document.getElementById( id );
Note: See TracChangeset for help on using the changeset viewer.