Skip to content

Commit

Permalink
reset camera on test page
Browse files Browse the repository at this point in the history
  • Loading branch information
sbittrich committed Oct 20, 2023
1 parent 05dbc80 commit 17f4760
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ <h2> RCSB PDB Mol* Viewer - Test Page</h2>
function loadExample(index) {
const e = examples[index];
// let URL, if specified, take precedence over ID
if (e.url) return viewer.loadStructureFromUrl(e.url, e.format ?? 'mmcif', e.isBinary ?? false, e.config)
if (e.id) return viewer.loadPdbId(e.id, e.config)
if (e.url) {
viewer.loadStructureFromUrl(e.url, e.format ?? 'mmcif', e.isBinary ?? false, e.config).then(_ => viewer.resetCamera(0))
}
if (e.id) {
viewer.loadPdbId(e.id, e.config).then(_ => viewer.resetCamera(0))
}
}

const examples = [
Expand Down

0 comments on commit 17f4760

Please sign in to comment.