diff --git a/client/static/js/main.js b/client/static/js/main.js index 3213721caccf1cde6749d3491e5e12824935de7e..e22f5f928ad9f0dd321ed2a6d19504784765a04f 100644 --- a/client/static/js/main.js +++ b/client/static/js/main.js @@ -35,38 +35,22 @@ $(document).ready(function() $('.button-delete-roadmap').click(function(event) { - var response = confirm("Do you really want to delete this roadmap?"); - if(response === true) - { - header("location: " + this.href); - } + confirmDelete("Do you really want to delete this roadmap?", this.href, event); }); $('.button-delete-milestone').click(function(event) { - var response = confirm("Do you really want to delete this milestone?"); - if(response === true) - { - header("location: " + this.href); - } + confirmDelete("Do you really want to delete this milestone?", this.href, event); }); $('.button-delete-task').click(function(event) { - var response = confirm("Do you really want to delete this task?"); - if(response === true) - { - header("location: " + this.href); - } + confirmDelete("Do you really want to delete this task?", this.href, event); }); $('.button-delete-subtask').click(function(event) { - var response = confirm("Do you really want to delete this subtask?"); - if(response === true) - { - header("location: " + this.href); - } + confirmDelete("Do you really want to delete this subtask?", this.href, event); }); $('#checkbox-done').click(function() @@ -96,6 +80,19 @@ $(document).ready(function() createTrainMap(); }); +function confirmDelete(message, redirectURL, event) +{ + var response = confirm(message); + if(response === true) + { + header("location: " + redirectURL); + } + else + { + event.preventDefault(); + } +} + function isNull(object) { return object === "" || object === undefined; diff --git a/client/version.json b/client/version.json index be24b87b64182a72c68c5acb7b2e7b0555c5ed96..13c0d7cb149cd4206f15163816117f79ed4277c5 100644 --- a/client/version.json +++ b/client/version.json @@ -1,7 +1,7 @@ { "version": { - "name": "v1.0.5", - "code": 6, - "date": "25.09.19" + "name": "v1.0.6", + "code": 7, + "date": "27.09.19" } } \ No newline at end of file