Skip to content

Commit

Permalink
Fixing cancel button behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
maricaantonacci committed Jul 18, 2019
1 parent 9e72315 commit 146ee64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/templates/createdep.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h4 class="font-weight-bold text-primary">
{% include 'default_form.html' %}
{% endif %}
<button type="submit" class="btn btn-success submitBtn">Submit</button>
<button type=button class="btn btn-small btn-primary" onclick="location.href='{{ url_for('depcreate') }}'">
<button id="cancelBtn" type=button class="btn btn-small btn-primary" onclick="location.href='{{ url_for('depcreate') }}'">
<span class="fas fa-ban mr-2"></span>Cancel</button>
</form>
</div>
Expand Down Expand Up @@ -107,6 +107,9 @@ <h4 class="font-weight-bold text-primary">
$(".submitBtn").attr("disabled", true);
// add spinner to button
$(".submitBtn").html( `<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Processing...` );
//disable cancel too
$("#cancelBtn").attr("disabled", true);
$("#cancelBtn").attr("onclick", "#");
return true;
});
});
Expand Down
5 changes: 3 additions & 2 deletions app/templates/deployments.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ <h5 class="modal-title" id="delete_confirm_label_{{deployment.uuid}}">Confirm de
Do you really want to delete the deployment {{deployment.uuid}}?
</div>
<div class="modal-footer">
<button id="cancelBtn" type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
<a id="deleteBtn" class="btn btn-danger" role="button" href="{{ url_for("depdel", depid=deployment.uuid) }}">Delete deployment</a>
<a id="cancelBtn" class="btn btn-primary text-white" role="button" data-dismiss="modal">Cancel</a>
<a id="deleteBtn" class="btn btn-danger" role="button" href="{{ url_for("depdel", depid=deployment.uuid) }}">Delete deployment</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -145,6 +145,7 @@ <h5 class="modal-title" id="details_label_{{deployment.uuid}}">Deployment detail
</div>
</div>
</div>

<script>
$(document).ready(function () {
$("#deleteBtn").click(function () {
Expand Down

0 comments on commit 146ee64

Please sign in to comment.