Skip to content

Commit 5057e9c

Browse files
committed
Fix macros in modmail (#963)
1 parent 5546015 commit 5057e9c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

extension/data/modules/macros.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,19 @@ export default new Module({
174174
getConfig(info.subreddit, (success, config) => {
175175
// if we're a mod, add macros to top level reply button.
176176
if (success && config.length > 0) {
177-
const macroButtonHtml =
178-
`<select class="tb-macro-select tb-action-button" data-subreddit="${info.subreddit}"><option value=${MACROS}>macros</option></select>`;
179-
$body.find('.ThreadViewerReplyForm__replyFooter .selectWrapper').before(
180-
`<div class="tb-usertext-buttons tb-macro-newmm">${macroButtonHtml}</div>`,
181-
);
177+
const macroButtonHtml = `
178+
<select class="tb-macro-select tb-action-button" data-subreddit="${info.subreddit}">
179+
<option value=${MACROS}>macros</option>
180+
</select>
181+
`;
182+
$body.find(`
183+
:is(
184+
.ThreadViewerReplyForm__replyFooter,
185+
.ThreadViewerReplyForm__replyFooterGroup
186+
) .selectWrapper
187+
`).before(`
188+
<div class="tb-usertext-buttons tb-macro-newmm">${macroButtonHtml}</div>
189+
`);
182190

183191
populateSelect('.tb-macro-select', info.subreddit, config, 'modmail');
184192
}

0 commit comments

Comments
 (0)