diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 81308c64..7231c51c 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -114,6 +114,20 @@ $(document).ready(function() { } }); +$(".session").click(function() { + window.sessionStorage.setItem("back", window.location.pathname); +}); + +$("#back").click(function() { + var loc = sessionStorage.getItem("back"); + if (!loc) { + loc = $(this).data("back"); + } + sessionStorage.removeItem("back"); + window.location.href = loc; + +}); + function confirmDialog(id, dialogid, dataValue, yesFn, noFn) { var $confirm = $("#" + dialogid); $confirm.modal('show'); diff --git a/cps/static/js/table.js b/cps/static/js/table.js index 7c4b04a7..d5a070c9 100644 --- a/cps/static/js/table.js +++ b/cps/static/js/table.js @@ -600,7 +600,7 @@ function responseHandler(res) { } function singleUserFormatter(value, row) { - return '' + this.buttontext + '' + return '' + this.buttontext + '' } function checkboxFormatter(value, row, index){ @@ -741,6 +741,6 @@ function queryParams(params) return params; } -function test(){ - console.log("hello"); +function storeLocation() { + window.sessionStorage.setItem("back", window.location.pathname); } diff --git a/cps/templates/admin.html b/cps/templates/admin.html index 5226151e..c06b7e72 100644 --- a/cps/templates/admin.html +++ b/cps/templates/admin.html @@ -26,7 +26,7 @@ {% for user in allUser %} {% if not user.role_anonymous() or config.config_anonbrowse %}