ailon / markerjs2

Add image annotation to your web apps.
https://markerjs.com
Other
142 stars 39 forks source link

Fill Color Button has same data-action value as Line Color Picker #175

Closed bennymeier closed 10 months ago

bennymeier commented 11 months ago

Hi,

if I use the EllipseMarker the Line Color Button has the same data-action value as the Fill Color Button. Both have the value color-picker-panel. See here:

<div class="__markerjs2__2_toolbox-button-row marker__toolbox__button-row">
  <div
    class="__markerjs2__2_toolbox_button marker__toolbox__button"
    title="Line color"
    role="button"
    aria-label="Line color"
    data-action="color-picker-panel"
  ></div>
  <div
    class="__markerjs2__2_toolbox_button marker__toolbox__button"
    title="Fill color"
    role="button"
    aria-label="Fill color"
    data-action="color-picker-panel"
  ></div>
  <div
    class="__markerjs2__2_toolbox_button marker__toolbox__button"
    title="Line width"
    role="button"
    aria-label="Line width"
    data-action="line-width-panel"
  ></div>
  <div
    class="__markerjs2__2_toolbox_button marker__toolbox__button"
    title="Line style"
    role="button"
    aria-label="Line style"
    data-action="line-style-panel"
  ></div>
  <div
    class="__markerjs2__2_toolbox_button marker__toolbox__button"
    title="Opacity"
    role="button"
    aria-label="Opacity"
    data-action="opacity-panel"
  ></div>
</div>

Edit: The Text Color Picker has also the data-action value of color-picker-panel. So I guess you use it internally to open the color-panel? Is there a way to change the data-action attribute to text-color-picker-panel, fill-color-picker-panel and line-color-picker-panel? If so, I can add my own language to the title and aria-label attributes on the buttons.

Best regards Benny

ailon commented 11 months ago

Hmm... I was afraid there could be gotchas when I added those based on your previous request and here we are 😅

I'll think about an internally proper way to mitigate this.

ailon commented 10 months ago

Sorry it took a minute with holidays and other stuff, but I think this should be fixed now with multiple instances of the same panel having unique data-action attributes.