mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-09 04:11:10 +01:00
9ce8d0f70e
git-svn-id: http://svn.automattic.com/wordpress/trunk@9114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
|
|
addComment = {
|
|
moveForm : function(commId, parentId, respondId) {
|
|
var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent');
|
|
|
|
if ( ! comm || ! respond || ! cancel || ! parent )
|
|
return;
|
|
|
|
t.respondId = respondId;
|
|
|
|
if ( ! t.I('wp-temp-form-div') ) {
|
|
div = document.createElement('div');
|
|
div.id = 'wp-temp-form-div';
|
|
div.style.display = 'none';
|
|
respond.parentNode.insertBefore(div, respond);
|
|
}
|
|
|
|
comm.parentNode.insertBefore(respond, comm.nextSibling);
|
|
parent.value = parentId;
|
|
cancel.style.display = '';
|
|
|
|
cancel.onclick = function() {
|
|
var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId);
|
|
|
|
if ( ! temp || ! respond )
|
|
return;
|
|
|
|
t.I('comment_parent').value = '0';
|
|
temp.parentNode.insertBefore(respond, temp);
|
|
temp.parentNode.removeChild(temp);
|
|
this.style.display = 'none';
|
|
this.onclick = null;
|
|
return false;
|
|
}
|
|
|
|
try { t.I('comment').focus(); }
|
|
catch(e) {}
|
|
|
|
return false;
|
|
},
|
|
|
|
I : function(e) {
|
|
return document.getElementById(e);
|
|
}
|
|
}
|