Page 1 of 1

How to change color and/or enable/disable custom action button

Posted: Sun Jan 01, 2023 1:32 am
by yvesf
Hello,


When clicking on the custom action button, we don't see the we have clicked and we may click several time.
There is an option to deactivate custom action button after few seconds to limit this risk in the setup. Thanks for that !
Is there another option to enable/disable the custom action button after having click on it? or for example changing the color after click ? How can you do that ? like it is done on save which moves from red (not save) to blue (saved)
Many thanks for your help,

Yves

Re: How to change color and/or enable/disable custom action button

Posted: Sun Jan 01, 2023 8:22 am
by kev1n
Normally action buttons should be disabled for 1.3 seconds after clicking them. However, it has turned out that this does not or does not always work reliably. I updated the function nuPreventButtonDblClick() in https://github.com/nuBuilder/nuBuilder-4.5/blob/eac5712b3b02269fb3219c9650c3375e6adfce04/core/nucommon.js#L2208.

If you do not want to update nuBuilder, copy & paste the function into Setup -> Header.

Good to know: It's possible to overwrite a JavaScript function by defining a new function with the same name. When you do this, the new function will replace the old function, and any calls to the function will use the new implementation.

Re: How to change color and/or enable/disable custom action button

Posted: Sun Jan 01, 2023 9:36 am
by yvesf
Hi kev1n,

The link provided (https://github.com/nuBuilder/nuBuilder- ... n.js#L2208) is notworking. Could you please update it ?
Many thanks,

Yves

Re: How to change color and/or enable/disable custom action button

Posted: Sun Jan 01, 2023 9:39 am
by kev1n
Strange - but your link works

Re: How to change color and/or enable/disable custom action button

Posted: Sun Jan 01, 2023 9:47 am
by kev1n
I had to update the function again