temporary hack, we need a full rewrite of element.ts

This commit is contained in:
velzie 2024-07-30 07:21:30 -04:00
parent b9f4eba034
commit acfa6d2c8a
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -82,6 +82,13 @@ export default function (client: ScramjetClient, self: typeof window) {
self.Element.prototype.getAttribute, self.Element.prototype.getAttribute,
{ {
apply(target, thisArg, argArray) { apply(target, thisArg, argArray) {
if (
attrs.includes(argArray[0]) &&
thisArg.hasAttribute(`data-${argArray[0]}`)
) {
return thisArg.getAttribute(`data-${argArray[0]}`);
}
if (attrs.includes(argArray[0]) && thisArg.$origattrs[argArray[0]]) { if (attrs.includes(argArray[0]) && thisArg.$origattrs[argArray[0]]) {
return thisArg.$origattrs[argArray[0]]; return thisArg.$origattrs[argArray[0]];
} }