mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 02:05:16 +02:00
Added the possibility to delete a U2F key.
This commit is contained in:
parent
069293a843
commit
3e56352688
7 changed files with 89 additions and 24 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue