mirror of
https://github.com/3dmol/3Dmol.js.git
synced 2026-06-04 08:39:49 +09:00
Fix bug with initial styling
Was happening after everything else instead of before.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -118,21 +118,23 @@ if(warn) {
|
||||
d = data[r][c]
|
||||
except:
|
||||
d = data
|
||||
cmds = "viewergrid_UNIQUEID[%d][%d].addModel(%s);\n"%(r,c,json.dumps(d))
|
||||
self.startjs += "viewergrid_UNIQUEID[%d][%d].addModel(%s);\n"%(r,c,json.dumps(d))
|
||||
if style:
|
||||
try:
|
||||
s = style[r][c]
|
||||
except:
|
||||
s = style
|
||||
cmds += "viewergrid_UNIQUEID[%d][%d].setStyle(%s);\n"%(r,c,json.dumps(s))
|
||||
self.endjs = cmds+"viewergrid_UNIQUEID[%d][%d].zoomTo(); viewergrid_UNIQUEID[%d][%d].render();\n"%(r,c,r,c) + self.endjs;
|
||||
self.startjs += cmds+"viewergrid_UNIQUEID[%d][%d].zoomTo();"%(r,c)
|
||||
self.endjs = "viewergrid_UNIQUEID[%d][%d].render();\n"%(r,c)+self.endjs;
|
||||
else:
|
||||
cmds = ''
|
||||
if data:
|
||||
cmds = "viewer_UNIQUEID.addModel(%s);\n"%json.dumps(data)
|
||||
if style:
|
||||
cmds += "viewer_UNIQUEID.setStyle(%s);\n"%json.dumps(style)
|
||||
self.endjs = cmds + "viewer_UNIQUEID.zoomTo();\nviewer_UNIQUEID.render();\n" + self.endjs;
|
||||
self.startjs += cmds + "viewer_UNIQUEID.zoomTo();\n"
|
||||
self.endjs = "viewer_UNIQUEID.render();\n" + self.endjs;
|
||||
|
||||
|
||||
@using_ipython
|
||||
|
||||
@@ -23,7 +23,7 @@ setup(
|
||||
# Versions should comply with PEP440. For a discussion on single-sourcing
|
||||
# the version across setup.py and the project code, see
|
||||
# https://packaging.python.org/en/latest/single_source_version.html
|
||||
version='0.9.0',
|
||||
version='0.9.1',
|
||||
|
||||
description='An IPython interface for embedding 3Dmol.js views',
|
||||
long_description=long_description,
|
||||
|
||||
Reference in New Issue
Block a user