Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 21 add toggle method #121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dstutemann
Copy link

Target Platform

  • Windows
  • Mac
  • Linux

What Problem does this solve?

This adds functionality requested in issue #21

Could it break existing functionality

No, this just adds a new function and does not modify existing functions

Additional Info

I have tested this using a test project on Windows and macOS. Somebody should test it on Linux as I am not a Linux user.

@Oxalin
Copy link
Collaborator

Oxalin commented Mar 19, 2024

Hi @dstutemann

Would it be simple and as efficient to use toggle() without any parameter? First, toggling is expected to change a given state to another one. Secondly, toggling with a parameter seems redundant to the enable() and disabled() methods, unless I'm missing something.

Also, I'm wondering if this should be added to the 5.x.x branch or the 6.x.x branch, which got rid of coffeescript. While we could add it to the 5.x.x branch, I don't know if we want to add/port new features to it?

@dstutemann
Copy link
Author

Hi @Oxalin,
I added the optional parameter value as it was requested in the issue. If you don't specify a parameter the function will toggle the state to the opposite, if you specify a parameter it will toggle to the desired state.

Unfortunately I can't see the 6.x.x branch.

I took the issue because it was marked as "good first issue". Feel free to close this PR if you decide that the feature isn't needed anymore.

@Oxalin
Copy link
Collaborator

Oxalin commented Mar 21, 2024

I think the feature would simplify some logic that many apps need to implement.

Under Code > Tags, the latest entry is 6.0.0-rc1.

@Oxalin Oxalin added this to the 6.1.0 milestone Apr 6, 2024
@Oxalin
Copy link
Collaborator

Oxalin commented Apr 6, 2024

I'll keep this PR opened until we add it directly under the new JS code. Once 6.0.0 is out the door, I'll add it to 6.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants