Docs: improve JS docs for `comment-reply.js`
Props andizer, ireneyoast. Fixes #41548. git-svn-id: https://develop.svn.wordpress.org/trunk@41314 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1d4fa31a99
commit
c1694b35d4
|
@ -1,4 +1,22 @@
|
||||||
|
/**
|
||||||
|
* @summary Handles the addition of the comment form.
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
*
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
var addComment = {
|
var addComment = {
|
||||||
|
/**
|
||||||
|
* @summary Retrieves the elements corresponding to the given IDs.
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
*
|
||||||
|
* @param {string} commId The comment ID.
|
||||||
|
* @param {string} parentId The parent ID.
|
||||||
|
* @param {string} respondId The respond ID.
|
||||||
|
* @param {string} postId The post ID.
|
||||||
|
* @returns {boolean} Always returns false.
|
||||||
|
*/
|
||||||
moveForm: function( commId, parentId, respondId, postId ) {
|
moveForm: function( commId, parentId, respondId, postId ) {
|
||||||
var div, element, style, cssHidden,
|
var div, element, style, cssHidden,
|
||||||
t = this,
|
t = this,
|
||||||
|
@ -30,6 +48,11 @@ var addComment = {
|
||||||
parent.value = parentId;
|
parent.value = parentId;
|
||||||
cancel.style.display = '';
|
cancel.style.display = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Puts back the comment, hides the cancel button and removes the onclick event.
|
||||||
|
*
|
||||||
|
* @returns {boolean} Always returns false.
|
||||||
|
*/
|
||||||
cancel.onclick = function() {
|
cancel.onclick = function() {
|
||||||
var t = addComment,
|
var t = addComment,
|
||||||
temp = t.I( 'wp-temp-form-div' ),
|
temp = t.I( 'wp-temp-form-div' ),
|
||||||
|
@ -48,8 +71,8 @@ var addComment = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set initial focus to the first form focusable element.
|
* Sets initial focus to the first form focusable element.
|
||||||
* Try/catch used just to avoid errors in IE 7- which return visibility
|
* Uses try/catch just to avoid errors in IE 7- which return visibility
|
||||||
* 'inherit' when the visibility value is inherited from an ancestor.
|
* 'inherit' when the visibility value is inherited from an ancestor.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
|
@ -90,6 +113,14 @@ var addComment = {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Returns the object corresponding to the given ID.
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
*
|
||||||
|
* @param {string} id The ID.
|
||||||
|
* @returns {Element} The element belonging to the ID.
|
||||||
|
*/
|
||||||
I: function( id ) {
|
I: function( id ) {
|
||||||
return document.getElementById( id );
|
return document.getElementById( id );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue