Added possibillity to delete attachments in admin page.

This commit is contained in:
Jan Böhmer 2019-04-06 18:38:36 +02:00
parent 72cd9a3722
commit 7c43feefbe
10 changed files with 133 additions and 19 deletions

View file

@ -256,12 +256,9 @@ class AjaxUI {
console.debug('Links registered!');
}
/**
* Register all forms for loading via ajax.
*/
public registerForm()
protected getFormOptions() : JQueryFormOptions
{
let options : JQueryFormOptions = {
return {
success: this.onAjaxComplete,
beforeSerialize: function() : boolean {
@ -285,12 +282,34 @@ class AjaxUI {
return true;
}
};
}
/**
* Register all forms for loading via ajax.
*/
public registerForm()
{
let options = this.getFormOptions();
$('form').not('[data-no-ajax]').ajaxForm(options);
console.debug('Forms registered!');
}
/**
* Submits the given form via ajax.
* @param form The form that will be submmitted.
*/
public submitForm(form)
{
let options = ajaxUI.getFormOptions();
$(form).ajaxSubmit(options);
}
/**
* Show the progressbar
*/