mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
add SeedDMSBox.callback()
This commit is contained in:
parent
3dd304eb98
commit
f0ffe1173e
|
@ -1544,6 +1544,9 @@ $(document).ready(function() { /* {{{ */
|
|||
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */
|
||||
|
||||
(function( SeedDMSBox, $, undefined ) { /* {{{ */
|
||||
/* Open dialog box and
|
||||
* redirect to the given url if confirm was pressed
|
||||
*/
|
||||
SeedDMSBox.redirect = function(url, boxparams) {
|
||||
bootbox.dialog(boxparams.message, [{
|
||||
"label" : boxparams.confirmLabel,
|
||||
|
@ -1558,4 +1561,22 @@ $(document).ready(function() { /* {{{ */
|
|||
}
|
||||
}]);
|
||||
}
|
||||
|
||||
/* Open confirm box and
|
||||
* calls the callback if the confirm button was pressed
|
||||
*/
|
||||
SeedDMSBox.callback = function(callback, boxparams) {
|
||||
bootbox.dialog(boxparams.message, [{
|
||||
"label" : boxparams.confirmLabel,
|
||||
"class" : "btn-danger",
|
||||
"callback": function() {
|
||||
callback();
|
||||
}
|
||||
}, {
|
||||
"label" : boxparams.cancelLabel,
|
||||
"class" : "btn-cancel",
|
||||
"callback": function() {
|
||||
}
|
||||
}]);
|
||||
}
|
||||
}( window.SeedDMSBox = window.SeedDMSBox || {}, jQuery )); /* }}} */
|
||||
|
|
|
@ -1600,6 +1600,9 @@ $(document).ready(function() { /* {{{ */
|
|||
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */
|
||||
|
||||
(function( SeedDMSBox, $, undefined ) { /* {{{ */
|
||||
/* Open confirm box (which has just one callback) and
|
||||
* redirect to the given url if confirm was pressed
|
||||
*/
|
||||
SeedDMSBox.redirect = function(url, boxparams) {
|
||||
bootbox.confirm({
|
||||
"message": boxparams.message,
|
||||
|
@ -1609,7 +1612,7 @@ $(document).ready(function() { /* {{{ */
|
|||
"className" : "btn-danger",
|
||||
},
|
||||
"cancel": {
|
||||
"label" : boxparams.cancelLabel,
|
||||
"label" : boxparams.cancelLabel,
|
||||
"className" : "btn-secondary",
|
||||
}
|
||||
},
|
||||
|
@ -1620,4 +1623,28 @@ $(document).ready(function() { /* {{{ */
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Open confirm box (which has just one callback) and
|
||||
* calls the callback if the confirm button was pressed
|
||||
*/
|
||||
SeedDMSBox.callback = function(callback, 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) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}( window.SeedDMSBox = window.SeedDMSBox || {}, jQuery )); /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user