mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 18:24:57 +02:00
Update the ProcessWire.alert() javascript function to support an expiration time after which the alert will automatically close.
This commit is contained in:
@@ -491,7 +491,7 @@ if(typeof ProcessWire != "undefined") {
|
||||
}
|
||||
};
|
||||
|
||||
ProcessWire.alert = function(message, allowMarkup) {
|
||||
ProcessWire.alert = function(message, allowMarkup, expire) {
|
||||
if(typeof allowMarkup == "undefined") var allowMarkup = false;
|
||||
if(typeof vex != "undefined") {
|
||||
if(allowMarkup) {
|
||||
@@ -505,6 +505,11 @@ if(typeof ProcessWire != "undefined") {
|
||||
}
|
||||
vex.dialog.alert(message);
|
||||
}
|
||||
if(typeof expire !== 'undefined') {
|
||||
setTimeout(function() {
|
||||
$('.vex-dialog-button-primary').trigger('click');
|
||||
}, expire);
|
||||
}
|
||||
} else {
|
||||
alert(message);
|
||||
}
|
||||
|
2
wire/templates-admin/scripts/main.min.js
vendored
2
wire/templates-admin/scripts/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user