mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 09:43:30 +00:00
Skip past our own reply buttons when displaying reply widget
Without this, the reply widget would be inserted before the reply button,
in the middle of the paragraph.
Follow-up to e36dc8e78a
.
Change-Id: I5e22a0a0b70e8da395eb23dd6ae80af70840a2e2
This commit is contained in:
parent
dbfbffd4f3
commit
5e1b6b1b81
|
@ -91,6 +91,11 @@ function addListItem( comment ) {
|
|||
desiredLevel = comment.level + 1;
|
||||
target = curComment.range.endContainer;
|
||||
|
||||
// HACK: Skip past our own reply buttons
|
||||
if ( target.nextSibling && target.nextSibling.className && target.nextSibling.className.indexOf( 'dt-init-replylink-buttons' ) !== -1 ) {
|
||||
target = target.nextSibling;
|
||||
}
|
||||
|
||||
// target is a text node or an inline element at the end of a "paragraph" (not necessarily paragraph node).
|
||||
// First, we need to find a block-level parent that we can mess with.
|
||||
// If we can't find a surrounding list item or paragraph (e.g. maybe we're inside a table cell
|
||||
|
|
Loading…
Reference in a new issue