Skip to content

Commit

Permalink
Quick Tags/Trim Reblogs: Fix buttons in Russian and Hindi (AprilSylp…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon authored Jun 2, 2024
1 parent a1ae685 commit c7ed4b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/scripts/quick_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { cloneControlButton, createControlButtonTemplate } from '../util/control
import { keyToCss } from '../util/css_map.js';
import { dom } from '../util/dom.js';
import { filterPostElements, getTimelineItemWrapper, postSelector } from '../util/interface.js';
import { translate } from '../util/language_data.js';
import { megaEdit } from '../util/mega_editor.js';
import { modalCancelButton, modalCompleteButton, showErrorModal, showModal } from '../util/modals.js';
import { onNewPosts, pageModifications } from '../util/mutations.js';
Expand Down Expand Up @@ -218,8 +217,9 @@ const processPosts = postElements => filterPostElements(postElements).forEach(po
const existingButton = postElement.querySelector(`.${buttonClass}`);
if (existingButton !== null) { return; }

const editButton = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"][aria-label=${translate('Edit')}]`);
if (!editButton) { return; }
const editIcon = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"] use[href="#managed-icon__edit"]`);
if (!editIcon) { return; }
const editButton = editIcon.closest('a');

const clonedControlButton = cloneControlButton(controlButtonTemplate, { click: togglePopupDisplay });
const controlIcon = editButton.closest(controlIconSelector);
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/trim_reblogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createControlButtonTemplate, cloneControlButton } from '../util/control
import { keyToCss } from '../util/css_map.js';
import { dom } from '../util/dom.js';
import { filterPostElements, postSelector } from '../util/interface.js';
import { translate } from '../util/language_data.js';
import { showModal, hideModal, modalCancelButton, showErrorModal } from '../util/modals.js';
import { onNewPosts } from '../util/mutations.js';
import { notify } from '../util/notifications.js';
Expand Down Expand Up @@ -160,8 +159,9 @@ const processPosts = postElements => filterPostElements(postElements).forEach(as
const existingButton = postElement.querySelector(`.${buttonClass}`);
if (existingButton !== null) { return; }

const editButton = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"][aria-label=${translate('Edit')}]`);
if (!editButton) { return; }
const editIcon = postElement.querySelector(`footer ${controlIconSelector} a[href*="/edit/"] use[href="#managed-icon__edit"]`);
if (!editIcon) { return; }
const editButton = editIcon.closest('a');

const { trail = [], content = [] } = await timelineObject(postElement);
const items = trail.length + (content.length ? 1 : 0);
Expand Down

0 comments on commit c7ed4b5

Please sign in to comment.