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

feat: refresh jsmind can set to center or not #613

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

YttriumC
Copy link
Contributor

当刷新或者显示脑图时可以自行选择是否居中
refresh jsmind can set to center or not.

Copy link
Owner

@hizzgdev hizzgdev left a comment

Choose a reason for hiding this comment

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

好奇这是一种什么使用场景,打开一个新的脑图难道不应该让它居中显示吗?你是为了“刷新” 当前这个脑图吗?

src/jsmind.js Outdated
this._reset();
this._show(mind);
this._show(mind, _keepCenter);
Copy link
Owner

Choose a reason for hiding this comment

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

this._show(mind, !!keepCenter);

A simpler way is to use double negation operators.

@YttriumC
Copy link
Contributor Author

YttriumC commented Jun 19, 2024 via email

@hizzgdev
Copy link
Owner

是为了保持旧版本兼容性

确实如此。出于这个原因的话我建议把参数改名为 skip_centering,默认 false,你觉得如何?

@hizzgdev hizzgdev merged commit c697559 into hizzgdev:master Jun 19, 2024
3 checks passed
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