Skip to content
Snippets Groups Projects
Commit 5f2d75b7 authored by Hugo Kerstens's avatar Hugo Kerstens
Browse files

Only single make live button at top

parent 3be508a7
Branches
No related tags found
1 merge request!47Add live code editing using thebelab
Pipeline #17082 passed
......@@ -31,7 +31,7 @@ window.addEventListener('load', function() {
{% endif %}
{% endblock %}
{% block data_svg %}
{% block data_priority %}
{% if cell.metadata.attributes and cell.metadata.attributes.editable == 'false' %}
{{ super() }}
{% else %}
......@@ -39,9 +39,6 @@ window.addEventListener('load', function() {
<div class="thebelab-output" data-output="true" markdown="1">
{{ super() }}
</div>
<button class="thebelab-button thebelab-activate-button" onclick="initThebelab()">
Enable live code
</button>
{% endif %}
{% endblock %}
......
......@@ -8,5 +8,7 @@ function initThebelab() {
let runButton = initDivs[i].firstElementChild.childNodes[1]
runButton.click();
}
}, 500)
}, 500)
let activateButton = document.getElementById("thebelab-activate-button");
activateButton.parentElement.removeChild(activateButton);
}
\ No newline at end of file
......@@ -6,10 +6,6 @@
display: none;
}
.thebelab-cell + p > button.thebelab-activate-button {
display: none;
}
.thebelab-button {
position: relative;
display: inline-block;
......@@ -40,7 +36,7 @@
color: rgba(0, 0, 0, 1)
}
.thebelab-activate-button {
#thebelab-activate-button {
margin-top: -1rem;
float: right;
}
......
......@@ -39,3 +39,7 @@
<!-- End ThebeLab config -->
{{ super() }}
{% endblock %}
{% block content %}
{{ super() | replace('</h1>', '</h1> <button id="thebelab-activate-button" class="thebelab-button" onclick="initThebelab()">Make live</button>', count=1) }}
{% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment