editor now refreshes when opened

This commit is contained in:
Max Robinson
2021-11-28 16:23:37 -06:00
parent 299213ad68
commit 12ca20cbf7
3 changed files with 17 additions and 7 deletions

View File

@@ -143,9 +143,12 @@ class ControlPanel {
$(tab).css('display', 'grid');
self.engine.organism_editor.is_active = (this.id == 'editor');
self.stats_panel.stopAutoRender();
if (this.id == 'stats') {
if (this.id === 'stats') {
self.stats_panel.startAutoRender();
}
else if (this.id === 'editor') {
self.editor_controller.refreshDetailsPanel();
}
self.tab_id = this.id;
});
}

View File

@@ -114,6 +114,13 @@ class EditorController extends CanvasController{
$('#edit-organism-details').css('display', 'none');
}
refreshDetailsPanel() {
if (this.mode === Modes.Edit)
this.setEditorPanel();
else
this.setDetailsPanel();
}
setDetailsPanel() {
this.clearDetailsPanel();
var org = this.env.organism;
@@ -124,11 +131,9 @@ class EditorController extends CanvasController{
if (Hyperparams.useGlobalMutability) {
$('#mutation-rate').css('display', 'none');
$('#mutation-rate-cont').css('display', 'none');
}
else {
$('#mutation-rate').css('display', 'block');
$('#mutation-rate-cont').css('display', 'block');
}
this.setMoveRangeVisibility();
@@ -150,6 +155,12 @@ class EditorController extends CanvasController{
}
$('#mutation-rate-edit').val(org.mutability);
if (Hyperparams.useGlobalMutability) {
$('#mutation-rate-cont').css('display', 'none');
}
else {
$('#mutation-rate-cont').css('display', 'block');
}
if (this.setBrainPanelVisibility()){
this.setBrainEditorValues($('#observation-type-edit').val());