mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-29 22:33:01 +00:00
Cancel button in User edit now leads to the right page back #1938
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -600,7 +600,7 @@ function responseHandler(res) {
|
||||
}
|
||||
|
||||
function singleUserFormatter(value, row) {
|
||||
return '<a class="btn btn-default" href="' + window.location.pathname + '/../../admin/user/' + row.id + '">' + this.buttontext + '</a>'
|
||||
return '<a class="btn btn-default" onclick="storeLocation()" href="' + window.location.pathname + '/../../admin/user/' + row.id + '">' + this.buttontext + '</a>'
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user