editor now refreshes when opened
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user