Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

SVG images cause error #7

Open
Pheil opened this issue May 10, 2023 · 0 comments
Open

SVG images cause error #7

Pheil opened this issue May 10, 2023 · 0 comments

Comments

@Pheil
Copy link

Pheil commented May 10, 2023

It looks like the _ctxMenusHas function needs tweaked to accommodate SVG images returning something besides the class names. Here's what I tried to fix the issue.

    if (element.className != undefined && element.hasAttribute("class")){ //Added this second condition
        //const classNames = element.className.split(" ");  //Original that seemed to be broken with SVGs
        const classNames = element.getAttribute("class").split(" ");
        for(var i = 0; i < classNames.length; i++) {
            if(this._ctxMenus.has("."+classNames[i])){
                return this._ctxMenus.get("."+classNames[i]);
            }
        }
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant