new-xkit / XKit

Fork of XKit, the extension framework for Tumblr
https://new-xkit-extension.tumblr.com
Other
459 stars 135 forks source link

XKit Preferences: Improve button click handler reliability #2117

Closed marcustyphoon closed 1 year ago

marcustyphoon commented 1 year ago

This fixes a small issue where, if XKit is loaded on a page which matches none of the criteria for button insertion, the XKit button will not do anything when clicked even after a later page mutation causes the button to be properly inserted. This is due to $("#xkit_button").click() unnecessarily relying on the button being attached to the DOM at the moment it runs.

This issue likely only happens when the dashboard is modified aggressively via e.g. userscripts or when Staff has made a change that the button insertion code has not yet been updated for.

marcustyphoon commented 1 year ago

(This does not currently contain a version bump to xkit_preferences.js)