Fix tab navigation

This commit is contained in:
Joseph Rollins
2023-04-26 09:23:48 -07:00
committed by GitHub
parent 8536af0845
commit 5d411e8985
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -12,7 +12,8 @@ window.addEventListener('hashchange', function () {
var has_errors = document.querySelectorAll(".messages .error");
if (!has_errors.length) {
if (document.location.hash == "") {
document.querySelector(".tabs ul li:first-child a").click();
const hash = document.querySelector(".tabs ul li:first-child a").href;
window.location.replaceState(undefined, undefined, hash);
} else {
set_active_tab();
}
@@ -153,10 +153,10 @@
class="recheck pure-button pure-button-primary">{% if watch.uuid in queued_uuids %}Queued{% else %}Recheck{% endif %}</a>
<a href="{{ url_for('edit_page', uuid=watch.uuid)}}" class="pure-button pure-button-primary">Edit</a>
{% if watch.history_n >= 2 %}
<a href="{{ url_for('diff_history_page', uuid=watch.uuid) }}" target="{{watch.uuid}}" class="pure-button pure-button-primary diff-link">Diff</a>
<a href="{{ url_for('diff_history_page', uuid=watch.uuid) }}" class="pure-button pure-button-primary diff-link">Diff</a>
{% else %}
{% if watch.history_n == 1 or (watch.history_n ==0 and watch.error_text_ctime )%}
<a href="{{ url_for('preview_page', uuid=watch.uuid)}}" target="{{watch.uuid}}" class="pure-button pure-button-primary">Preview</a>
<a href="{{ url_for('preview_page', uuid=watch.uuid)}}" class="pure-button pure-button-primary">Preview</a>
{% endif %}
{% endif %}
</td>