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

Updated default values handling to one liner #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

git-kamesh
Copy link

No description provided.

Comment on lines +2 to +7
grab = grab || function() {};
release = release || function() {};
snapping = snapping || function () { true; }
rearrange = rearrange || function () { false; }
spacing_x = typeof spacing_x == undefined ? 20 : spacing_x;
spacing_y = typeof spacing_y == undefined ? 20 : spacing_y;
Copy link

@Jhoubert Jhoubert Feb 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You code is breaking the normal behavior since is expecting a value, you're missing it, this is a working one-liner.

Suggested change
grab = grab || function() {};
release = release || function() {};
snapping = snapping || function () { true; }
rearrange = rearrange || function () { false; }
spacing_x = typeof spacing_x == undefined ? 20 : spacing_x;
spacing_y = typeof spacing_y == undefined ? 20 : spacing_y;
grab = grab || function() {};
release = release || function() {};
snapping = snapping || function () {return true; }
rearrange = rearrange || function () { return false; }
spacing_x = !spacing_x ? 20 : spacing_x;
spacing_y = !spacing_y ? 80: spacing_y;

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.

None yet

2 participants