Added the possibility to delete a U2F key.

This commit is contained in:
Jan Böhmer 2019-12-29 16:20:09 +01:00
parent 069293a843
commit 3e56352688
7 changed files with 89 additions and 24 deletions

View file

@ -297,11 +297,17 @@ class AjaxUI {
/**
* Submits the given form via ajax.
* @param form The form that will be submmitted.
* @param btn The btn via which the form is submitted
*/
public submitForm(form)
public submitForm(form, btn = null)
{
let options = ajaxUI.getFormOptions();
if(btn) {
options.data = {};
options.data[$(btn).attr('name')] = $(btn).attr('value');
}
$(form).ajaxSubmit(options);
}

View file

@ -190,6 +190,9 @@ $(document).on("ajaxUI:start ajaxUI:reload", function() {
let form = this;
//Get the submit button
let btn = document.activeElement;
let title = $(this).data("title");
let message = $(this).data("message");
@ -199,7 +202,7 @@ $(document).on("ajaxUI:start ajaxUI:reload", function() {
callback: function(result) {
//If the dialog was confirmed, then submit the form.
if(result) {
ajaxUI.submitForm(form);
ajaxUI.submitForm(form, btn);
}
}});