Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control button CSS is unreliable #2136

Open
marcustyphoon opened this issue Sep 27, 2023 · 0 comments
Open

Control button CSS is unreliable #2136

marcustyphoon opened this issue Sep 27, 2023 · 0 comments

Comments

@marcustyphoon
Copy link

get_control_button_template: async function() {
await XKit.css_map.getCssMap();
var selector = XKit.css_map.keyToClasses("controlIcon").map(css => `[data-id]:first footer .${css}:first`).join(", ");
var control = $(selector);
var get_used_class_from_map = function(key) {
const keyCss = XKit.css_map.keyToCss(key);
var element = control.find(keyCss);
return element.attr("class");
};
var controlIconClass = control.attr("class");
var buttonClass = get_used_class_from_map("button");
var new_control = `
<div class="${controlIconClass} {{className}} xkit-interface-control-button" title="{{text}}" {{additional}}>
<button class="${buttonClass}" aria-label="" tabindex="0">
<div class="xkit-interface-icon" {{data}}></div>
</button>
</div>
`;
this.control_button_template = new_control;
return this.control_button_template;
},

[data-id]:first footer will not match anything in this code if the first post loaded by the user is a filtered post, which makes "controlIconClass" and "buttonClass" equal to the string 'undefined', which makes post controls look like this:

I assume there's no point in me reporting this, really, since this codebase is super dead and I would be the one fixing it if anyone would, but hey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant