Construct message/confirmation dialogs programmatically
No need to have templates here, we do it directly from the helper methods. That also leaves us more options regarding callbacks, classes etc. Helper methods now take an options dictionary (but still can fallback to the old signature) containing messages, titles, callbacks etc instead of using positional arguments for that. Switched code over to utilize that new calling approach.
This commit is contained in:
1 parent
1238507806
commit
ea662849bc
8 files changed
+79
-62
No files matched your search
@@ -277,10 +277,11 @@ $(function() {
|
||||
type: "error"
|
||||
});
|
||||
} else {
|
||||
showConfirmationDialog(gettext("This will update your OctoPrint installation and restart the server."), function(e) {
|
||||
e.preventDefault();
|
||||
$("#confirmation_dialog").modal("hide");
|
||||
self.performUpdate(force);
|
||||
showConfirmationDialog({
|
||||
message: gettext("This will update your OctoPrint installation and restart the server."),
|
||||
onproceed: function(e) {
|
||||
self.performUpdate(force);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user