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

Editor: Export JSON = Download #28221

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

Conversation

ycw
Copy link
Contributor

@ycw ycw commented Apr 25, 2024

Related issue: #28209

This PR changes 'EXPORT JSON' button behavior to satisfy user needs:

clicking the button will now download the JSON file instead of dumping string in a small new window.

@ycw
Copy link
Contributor Author

ycw commented Apr 25, 2024

const top = ( screen.height - 500 ) / 2;

const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain;charset=utf-8' } ) );
window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
Copy link
Collaborator

@Mugen87 Mugen87 Apr 26, 2024

Choose a reason for hiding this comment

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

@mrdoob Was there a special reason for showing the JSON in a new window? Maybe we overlook a use case here...

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