UI - Show error/warning when trying to compare the same version

pull/2147/head^2
dgtlmoon 9 months ago
parent e9a9790cb0
commit 4b49759113

@ -90,5 +90,10 @@ $(document).ready(function () {
} }
} }
$('#diff-form').on('submit', function (e) {
if ($('select[name=from_version]').val() === $('select[name=to_version]').val()) {
e.preventDefault();
alert('Error - You are trying to compare the same version.');
}
});
}); });

@ -13,7 +13,7 @@
<script src="{{url_for('static_content', group='js', filename='diff-overview.js')}}" defer></script> <script src="{{url_for('static_content', group='js', filename='diff-overview.js')}}" defer></script>
<div id="settings"> <div id="settings">
<form class="pure-form " action="" method="GET"> <form class="pure-form " action="" method="GET" id="diff-form">
<fieldset> <fieldset>
{% if versions|length >= 1 %} {% if versions|length >= 1 %}
<strong>Compare</strong> <strong>Compare</strong>

Loading…
Cancel
Save