Commit 8fb9d081 authored by Efthymia Bika's avatar Efthymia Bika
Browse files

Replace plain confirm with foundation modal

parent b12ae032
......@@ -166,11 +166,19 @@ function run_duplicity(restore, force) {
if(exist_error) {
$("#msg").html("");
$("#msg").removeClass("panel");
var msg = "Destination already exists. Overwrite?";
if(confirm(msg)) {
$("#loader").show();
run_duplicity(true, true);
}
$("#modal-confirm").foundation("reveal", "open");
var i = 0;
$("#modal-confirm").on('close.fndtn.reveal', function(e) {
if(e.namespace !== "fndtn.reveal") return;
i++;
$(this).click(function(event) {
// event is fired more than once so have to check
if(event.target.id == "modal-accept" && i == 1) {
$("#loader").show();
run_duplicity(true, true);
}
});
});
}
var gpg_error = new RegExp("GPGError: GPG Failed").exec(stderr);
if(gpg_error) {
......
......@@ -196,6 +196,19 @@
<i class="fa fa-spinner fa-pulse fa-2x gray-spin"></i>
</div>
<div id="msg" class="small-10 columns"></div>
<div id="modal-confirm" class="reveal-modal medium"
data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog">
<p id="modal-p">Destination already exists. Do you wish to overwrite?</p>
<a id="modal-cancel" class="button radius small"
onclick="$('#modal-confirm').foundation('reveal', 'close');">
Cancel
</a>
<a id="modal-accept" class="button radius small alert right"
onclick="$('#modal-confirm').foundation('reveal', 'close');">
Overwrite
</a>
<a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
</div>
</div>
<script type="text/javascript">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment