Disable opacity option for just eraser tool

Hello,

Is it possible to disable/remove opacity option for just eraser tool and keeping it default as 100%.
I tried it using instance.disableElements() but it disable opacity for every tool.
Also for setting opacity to 100% always i tried instance.Tools.EraserTool.prototype.setStyles
but it doesn’t set opacity to 100% automatically.

So is there any solution or work around?

Regards
Abhishek Maurya

Hi,

One way to achieve this is to listen to the toolModeUpdated event and disable the slider when it’s the current tool is the eraser tool, and re-enable the slider back when the current tool becomes others.

Best Reagrds,
Zhijie

Hello @zzhang,
I can disable slider using document.getelementby class name as there is no
data-element associated with it, but could you please tell me
how can i set opacity to 100% before disabling slider?

Regards
Abhishek Maurya

Hi,

The next version of express will add data-element to sliders so you can use instance.disableElements to remove it when the eraser tool is selected.

Thanks,
Zhijie