Verified Commit 7d2e089c authored by Marco Kellershoff's avatar Marco Kellershoff 🤸
Browse files

Hide output "window" on load

Show only when "Run"-button is pressed and "isCompilable" === true
parent 1ed9a6bc
...@@ -288,6 +288,7 @@ ...@@ -288,6 +288,7 @@
}; };
this.autoRun = function() { this.autoRun = function() {
this.showAndHideOutput();
window.mockhtml(); window.mockhtml();
var app = document.querySelector('#app'); var app = document.querySelector('#app');
var logo = document.querySelector('#logo'); var logo = document.querySelector('#logo');
...@@ -401,17 +402,27 @@ ...@@ -401,17 +402,27 @@
return comp.includes(current_syntax); return comp.includes(current_syntax);
}; };
this.showAndHideRun = function() { this.showAndHideOutput = function() {
var is_compilable = self.isCompilable(); var is_compilable = self.isCompilable();
if (is_compilable === false) { if (is_compilable === false) {
$(col1).removeClass('col-xs-6'); $(col1).removeClass('col-xs-6');
$(col1).addClass('col-xs-12'); $(col1).addClass('col-xs-12');
$(col2).addClass('hidden'); $(col2).addClass('hidden');
btn_run.style.display = 'none';
} else { } else {
$(col1).addClass('col-xs-6'); $(col1).addClass('col-xs-6');
$(col1).removeClass('col-xs-12'); $(col1).removeClass('col-xs-12');
$(col2).removeClass('hidden'); $(col2).removeClass('hidden');
}
};
this.showAndHideRun = function() {
var is_compilable = self.isCompilable();
$(col1).removeClass('col-xs-6');
$(col1).addClass('col-xs-12');
$(col2).addClass('hidden');
if (is_compilable === false) {
btn_run.style.display = 'none';
} else {
btn_run.style.display = 'inline-block'; btn_run.style.display = 'inline-block';
} }
}; };
...@@ -513,6 +524,7 @@ ...@@ -513,6 +524,7 @@
btn_run.onclick = function(evt){ btn_run.onclick = function(evt){
evt.preventDefault(); evt.preventDefault();
self.showAndHideOutput();
window.mockhtml(); window.mockhtml();
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment