Skip to content

Commit

Permalink
Refactor: Standardize capitalization of "onclick" (#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon authored Jan 7, 2025
1 parent f1890e1 commit 317a3de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/features/scroll_to_bottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const stopScrolling = () => {
scrollToBottomButton?.classList.remove(activeClass);
};

const onClick = () => active ? stopScrolling() : startScrolling();
const onclick = () => active ? stopScrolling() : startScrolling();
const onKeyDown = ({ key }) => key === '.' && stopScrolling();

const checkForButtonRemoved = () => {
Expand All @@ -76,7 +76,7 @@ const addButtonToPage = async function ([scrollToTopButton]) {
scrollToBottomButton.removeAttribute('aria-label');
scrollToBottomButton.style.marginTop = '0.5ch';
scrollToBottomButton.style.transform = 'rotate(180deg)';
scrollToBottomButton.addEventListener('click', onClick);
scrollToBottomButton.addEventListener('click', onclick);
scrollToBottomButton.id = scrollToBottomButtonId;

scrollToBottomButton.classList[active ? 'add' : 'remove'](activeClass);
Expand Down
10 changes: 5 additions & 5 deletions src/utils/meatballs.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ export const unregisterMeatballItem = id => {
* @param {object} options - Destructured
* @param {string} options.id - Identifier for this button (must be unique)
* @param {string|Function} options.label - Button text to display. May be a function accepting the blog data of the post element being actioned on.
* @param {Function} options.onClick - Button click listener function
* @param {Function} options.onclick - Button click listener function
* @param {Function} [options.blogFilter] - Filter function, called with the blog data of the menu element being actioned on. Must return true for button to be added. Some blog data fields, such as "followed", are not available in blog cards.
*/
export const registerBlogMeatballItem = function ({ id, label, onClick, blogFilter }) {
blogMeatballItems[id] = { label, onClick, blogFilter };
export const registerBlogMeatballItem = function ({ id, label, onclick, blogFilter }) {
blogMeatballItems[id] = { label, onclick, blogFilter };
pageModifications.trigger(addMeatballItems);
};

Expand Down Expand Up @@ -111,14 +111,14 @@ const addBlogMeatballItem = async meatballMenu => {
$(meatballMenu).children('[data-xkit-blog-meatball-button]').remove();

Object.keys(blogMeatballItems).sort().forEach(id => {
const { label, onClick, blogFilter } = blogMeatballItems[id];
const { label, onclick, blogFilter } = blogMeatballItems[id];

const meatballItemButton = dom('button', {
class: 'xkit-meatball-button',
'data-xkit-blog-meatball-button': id,
hidden: true
}, {
click: onClick
click: onclick
}, [
'\u22EF'
]);
Expand Down

0 comments on commit 317a3de

Please sign in to comment.