mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-25 00:38:33 +00:00
Merge "Fix skipping past our own reply buttons for wrapped comments"
This commit is contained in:
commit
234198d9b1
|
@ -91,11 +91,6 @@ function addListItem( comment ) {
|
||||||
desiredLevel = comment.level + 1;
|
desiredLevel = comment.level + 1;
|
||||||
target = curComment.range.endContainer;
|
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).
|
// 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.
|
// 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
|
// If we can't find a surrounding list item or paragraph (e.g. maybe we're inside a table cell
|
||||||
|
@ -107,6 +102,11 @@ function addListItem( comment ) {
|
||||||
// parent is a list item or paragraph (hopefully)
|
// parent is a list item or paragraph (hopefully)
|
||||||
// target is an inline node within it
|
// target is an inline node within it
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
// Instead of just using curComment.level, consider indentation of lists within the
|
// Instead of just using curComment.level, consider indentation of lists within the
|
||||||
// comment (T252702)
|
// comment (T252702)
|
||||||
curLevel = utils.getIndentLevel( target, curComment.rootNode ) + 1;
|
curLevel = utils.getIndentLevel( target, curComment.rootNode ) + 1;
|
||||||
|
|
Loading…
Reference in a new issue