1
0
mirror of https://gitlab.com/brutaldon/brutaldon.git synced 2024-12-04 14:46:24 -05:00

Don't create expandCWs button multiple times

This commit is contained in:
Jason F. McBrayer 2018-09-06 13:36:27 -04:00
parent d9cb4b36e5
commit 3407aa8086
2 changed files with 27 additions and 28 deletions

View File

@ -67,7 +67,10 @@ function menuPrepare() {
function expandCWButtonPrepare() function expandCWButtonPrepare()
{ {
var theButton = document.createElement('p'); var theButton = document.querySelector('#expandCWs');
if (!theButton) {
theButton = document.createElement('p');
theButton.id = "expandCWs";
theButton.textContent = "Expand CWs"; theButton.textContent = "Expand CWs";
theButton.classList.toggle('button'); theButton.classList.toggle('button');
document.querySelector('#title').insertAdjacentElement('afterend', theButton); document.querySelector('#title').insertAdjacentElement('afterend', theButton);
@ -93,6 +96,7 @@ function expandCWButtonPrepare()
}); });
}; };
} }
}
function fileButtonUpdaters() function fileButtonUpdaters()
{ {

View File

@ -36,8 +36,3 @@ mastodon.status_context(<numerical id>)
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block page_scripts_inline %}
<script type="application/javascript">
document.addEventListener('DOMContentLoaded', expandCWButtonPrepare);
</script>
{% endblock %}