varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.43k stars 83 forks source link

Can't figure out where in the code Panel gets unhidden when an Arrow gets selected, please guide us! 🙏 #204

Closed enjoysmath closed 10 months ago

enjoysmath commented 10 months ago

So I'm overriding the default Arrow panel by just hiding it because I don't know the consequences of completely disabling that. I would eventually do that with .panel { display: none; } in main.css.

However, currently, I am able to figure out that Panel.hide() does the hiding so that I snuck my call in to hide my "#arrow-gear-button".

However, I'm currently unable to figure out where Panel is shown again. Any hints?

Thanks,

Heres' a screenshot:

image

This navigation is responsive. It switches to:

image

Anyhow, inside of your Panel.hide() method I have:

    /// Hide the panel off-screen.
    hide(ui) {
        if (ui.colour_picker.is_targeting(ColourPicker.TARGET.Edge)) {
            ui.colour_picker.close();
        }
        this.element.class_list.add("hidden");
        parent.set_enabled_arrow_edit_button(false);    // ADDED LINE
        this.defocus_inputs();
    }

And set_enabled_arrow_edit_button() looks like this in my _javascripttools

function set_enabled_arrow_edit_button(en)
{
    if (en)
    {
        $("#arrow-gear-button").css("display", "flex !important");    //   THIS LINE NEVER GETS CALLED; BECAUSE I NEVER CALL IT!
    }
    else {
        $("#arrow-gear-button").css("display", "none !important");    //  THIS LINE SEEMS TO WORK, NOT 100% SURE THOUGH.
    }
}

Anyway, where can I place the corresponding call to set_enabled_arrow_edit_button(true)?

Thanks! 😎

enjoysmath commented 10 months ago

image