From 17f4760352796308cac08833bc547eeed8cc7dd5 Mon Sep 17 00:00:00 2001 From: Sebastian Bittrich Date: Fri, 20 Oct 2023 09:23:00 -0700 Subject: [PATCH] reset camera on test page --- src/viewer/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/viewer/index.html b/src/viewer/index.html index 07f2c2c..da4597d 100644 --- a/src/viewer/index.html +++ b/src/viewer/index.html @@ -106,8 +106,12 @@

RCSB PDB Mol* Viewer - Test Page

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 = [