add SeedDMSBox.redirect()

This commit is contained in:
Uwe Steinmann 2023-10-14 10:44:23 +02:00
parent 69cab29178
commit a2676573a6
2 changed files with 40 additions and 0 deletions

View File

@ -1542,3 +1542,20 @@ $(document).ready(function() { /* {{{ */
}
}
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */
(function( SeedDMSBox, $, undefined ) { /* {{{ */
SeedDMSBox.redirect = function(url, boxparams) {
bootbox.dialog(boxparams.message, [{
"label" : boxparams.confirmLabel,
"class" : "btn-danger",
"callback": function() {
window.location.href = url;
}
}, {
"label" : boxparams.cancelLabel,
"class" : "btn-cancel",
"callback": function() {
}
}]);
}
}( window.SeedDMSBox = window.SeedDMSBox || {}, jQuery )); /* }}} */

View File

@ -1598,3 +1598,26 @@ $(document).ready(function() { /* {{{ */
}
}
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */
(function( SeedDMSBox, $, undefined ) { /* {{{ */
SeedDMSBox.redirect = function(url, boxparams) {
bootbox.confirm({
"message": boxparams.message,
"buttons": {
"confirm": {
"label" : boxparams.confirmLabel,
"className" : "btn-danger",
},
"cancel": {
"label" : boxparams.cancelLabel,
"className" : "btn-secondary",
}
},
"callback": function(result) {
if(result) {
window.location.href = url;
}
}
});
}
}( window.SeedDMSBox = window.SeedDMSBox || {}, jQuery )); /* }}} */