-
{svg_image}
+ this.current_style = this.state.isToggleOn || this.state.complexOn ? selected_style : this.not_selected_style;
+ return
+
{svg_image}
{this.props.data.protein_code}
-
Complex ON}
- off={Complex OFF
}
- size="xs"
- offstyle="danger"
- active={this.state.complexOn}/>
- Vector ON}
- off={Vector OFF
}
- size="xs"
- offstyle="danger"
- active={this.props.to_query==this.props.data.smiles}/>
+
+
+ Complex
+ Ligand
+ Vectors
+
+
}
@@ -160,8 +195,13 @@ class MoleculeView extends GenericView {
return colourList[this.props.data.id % colourList.length];
}
- handleClick(e) {
- this.setState(prevState => ({isToggleOn: !prevState.isToggleOn}))
+ handleClick(new_list=undefined) {
+ if(new_list!=undefined){
+ this.setState(prevState => ({isToggleOn: !prevState.isToggleOn, value: new_list}));
+ }
+ else{
+ this.setState(prevState => ({isToggleOn: !prevState.isToggleOn}))
+ }
if(this.state.isToggleOn){
this.props.deleteObject(Object.assign({display_div: "major_view"}, this.generateMolObject()))
this.props.removeFromFragmentDisplayList(this.generateMolId())
@@ -172,8 +212,13 @@ class MoleculeView extends GenericView {
}
}
- onComplex() {
- this.setState(prevState => ({complexOn: !prevState.complexOn}))
+ onComplex(new_list=undefined) {
+ if(new_list!=undefined) {
+ this.setState(prevState => ({complexOn: !prevState.complexOn, value: new_list}))
+ }
+ else{
+ this.setState(prevState => ({complexOn: !prevState.complexOn}))
+ }
if(this.state.complexOn){
this.props.deleteObject(Object.assign({display_div: "major_view"}, this.generateObject()))
this.props.removeFromComplexList(this.generateMolId())
@@ -181,14 +226,16 @@ class MoleculeView extends GenericView {
else{
this.props.loadObject(Object.assign({display_div: "major_view"}, this.generateObject()))
this.props.appendComplexList(this.generateMolId())
- if(this.state.isToggleOn==false){
- this.handleClick()
- }
}
}
- onVector() {
- this.setState(prevState => ({vectorOn: !prevState.vectorOn}))
+ onVector(new_list=undefined) {
+ if(new_list!=undefined) {
+ this.setState(prevState => ({vectorOn: !prevState.vectorOn, value: new_list}))
+ }
+ else{
+ this.setState(prevState => ({vectorOn: !prevState.vectorOn}))
+ }
if(this.state.vectorOn) {
this.props.vector_list.forEach(item => this.props.deleteObject(Object.assign({display_div: "major_view"}, item)));
this.props.setMol("");
diff --git a/js/containers/fraggleBoxHolder.js b/js/containers/fraggleBoxHolder.js
index 5a0a228a5..f75248595 100644
--- a/js/containers/fraggleBoxHolder.js
+++ b/js/containers/fraggleBoxHolder.js
@@ -41,7 +41,6 @@ class FraggleBox extends Component {
-
diff --git a/js/containers/previewHolder.js b/js/containers/previewHolder.js
index 0d2295971..350abfea7 100644
--- a/js/containers/previewHolder.js
+++ b/js/containers/previewHolder.js
@@ -119,7 +119,7 @@ class Preview extends Component {
-
+
From f1bf2808794fda741311482a014a48507de1e774 Mon Sep 17 00:00:00 2001
From: Richard Gillams <37295433+ricgillams@users.noreply.github.com>
Date: Mon, 17 Sep 2018 12:13:57 +0100
Subject: [PATCH 2/2] Bug Fix - compound loading and navigation (#20)
- Compound list shows as loading during loading.
- Fixed bug which caused navigation to end of compound list on rightClick after onClick action.
- Cleaned up unused code.
---
js/components/compoundList.js | 12 ++++++------
js/components/generalComponents.js | 2 +-
js/components/header.js | 2 +-
js/components/modalLoadingScreen.js | 1 -
js/components/summaryView.js | 2 +-
js/components/targetList.js | 2 +-
js/configureStore.js | 2 +-
js/containers/app.js | 3 +--
js/containers/fraggleBoxHolder.js | 2 +-
js/containers/previewHolder.js | 2 +-
js/utils/ngl_functions.js | 1 -
js/utils/util.js | 24 +-----------------------
12 files changed, 15 insertions(+), 40 deletions(-)
diff --git a/js/components/compoundList.js b/js/components/compoundList.js
index cc6131fc7..8aacc310d 100644
--- a/js/components/compoundList.js
+++ b/js/components/compoundList.js
@@ -16,9 +16,8 @@ class CompoundList extends React.Component {
this.handleClassNaming = this.handleClassNaming.bind(this);
this.selectAll = this.selectAll.bind(this);
this.clearAll = this.clearAll.bind(this);
- this.highlightFirstCompound = this.highlightFirstCompound.bind(this)
- this.colourClassBoxes = this.colourClassBoxes.bind(this)
-
+ this.highlightFirstCompound = this.highlightFirstCompound.bind(this);
+ this.colourClassBoxes = this.colourClassBoxes.bind(this);
}
handleClassNaming(e){
@@ -28,7 +27,6 @@ class CompoundList extends React.Component {
var classDescription = this.props.compoundClasses;
var descriptionToSet = Object.assign(classDescription, newClassDescription);
this.props.setCompoundClasses(descriptionToSet);
- var newCurrentClass = e.target.id;
this.props.setCurrentCompoundClass(e.target.id);
}
}
@@ -93,14 +91,14 @@ class CompoundList extends React.Component {
render() {
var numMols = this.getNum();
- var mol_string = "No mols found!!!";
+ var mol_string = "Loading...";
if(numMols){
mol_string = "Compounds to pick. Mol total: " + numMols
}
if(this.props.to_query=="" || this.props.to_query==undefined) {
mol_string = ""
}
- if (this.props.currentVector != undefined) {
+ if (this.props.to_query != undefined) {
var totArray = []
totArray.push()
totArray.push()
@@ -142,6 +140,8 @@ function mapStateToProps(state) {
compoundClasses: state.selectionReducers.present.compoundClasses,
currentCompoundClass: state.selectionReducers.present.currentCompoundClass,
to_select: state.selectionReducers.present.to_select,
+ objectsInView: state.nglReducers.present.objectsInView,
+ querying: state.selectionReducers.present.querying,
}
}
const mapDispatchToProps = {
diff --git a/js/components/generalComponents.js b/js/components/generalComponents.js
index f02827da6..e0c32d495 100644
--- a/js/components/generalComponents.js
+++ b/js/components/generalComponents.js
@@ -158,7 +158,7 @@ export class GenericView extends React.Component{
this.handleClick = this.handleClick.bind(this);
this.not_selected_style = {width: props.width.toString+'px', height: props.height.toString()+'px'}
this.old_url = ''
- this.state = {isConfOn: false, isToggleOn: false, img_data: '