editor now refreshes when opened
This commit is contained in:
@@ -143,9 +143,12 @@ class ControlPanel {
|
|||||||
$(tab).css('display', 'grid');
|
$(tab).css('display', 'grid');
|
||||||
self.engine.organism_editor.is_active = (this.id == 'editor');
|
self.engine.organism_editor.is_active = (this.id == 'editor');
|
||||||
self.stats_panel.stopAutoRender();
|
self.stats_panel.stopAutoRender();
|
||||||
if (this.id == 'stats') {
|
if (this.id === 'stats') {
|
||||||
self.stats_panel.startAutoRender();
|
self.stats_panel.startAutoRender();
|
||||||
}
|
}
|
||||||
|
else if (this.id === 'editor') {
|
||||||
|
self.editor_controller.refreshDetailsPanel();
|
||||||
|
}
|
||||||
self.tab_id = this.id;
|
self.tab_id = this.id;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,13 @@ class EditorController extends CanvasController{
|
|||||||
$('#edit-organism-details').css('display', 'none');
|
$('#edit-organism-details').css('display', 'none');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshDetailsPanel() {
|
||||||
|
if (this.mode === Modes.Edit)
|
||||||
|
this.setEditorPanel();
|
||||||
|
else
|
||||||
|
this.setDetailsPanel();
|
||||||
|
}
|
||||||
|
|
||||||
setDetailsPanel() {
|
setDetailsPanel() {
|
||||||
this.clearDetailsPanel();
|
this.clearDetailsPanel();
|
||||||
var org = this.env.organism;
|
var org = this.env.organism;
|
||||||
@@ -124,11 +131,9 @@ class EditorController extends CanvasController{
|
|||||||
|
|
||||||
if (Hyperparams.useGlobalMutability) {
|
if (Hyperparams.useGlobalMutability) {
|
||||||
$('#mutation-rate').css('display', 'none');
|
$('#mutation-rate').css('display', 'none');
|
||||||
$('#mutation-rate-cont').css('display', 'none');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#mutation-rate').css('display', 'block');
|
$('#mutation-rate').css('display', 'block');
|
||||||
$('#mutation-rate-cont').css('display', 'block');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setMoveRangeVisibility();
|
this.setMoveRangeVisibility();
|
||||||
@@ -150,6 +155,12 @@ class EditorController extends CanvasController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#mutation-rate-edit').val(org.mutability);
|
$('#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()){
|
if (this.setBrainPanelVisibility()){
|
||||||
this.setBrainEditorValues($('#observation-type-edit').val());
|
this.setBrainEditorValues($('#observation-type-edit').val());
|
||||||
|
|||||||
@@ -105,8 +105,4 @@ class Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $("body").mousemove(function(e) {
|
|
||||||
// console.log("hello");
|
|
||||||
// });
|
|
||||||
|
|
||||||
module.exports = Renderer;
|
module.exports = Renderer;
|
||||||
|
|||||||
Reference in New Issue
Block a user