mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-18 03:00:56 +01:00
Add the correct task from the button clicked. Not be the best solution but solved the problem. Looking for a more correct solution later.
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
var root = window || {};
|
||||
root = root.GravJS = root.GravJS || {};
|
||||
|
||||
root.clickedButton = null;
|
||||
$(document).on('click', 'button.task', function(e) {
|
||||
root.clickedButton = e.target;
|
||||
});
|
||||
|
||||
function addTypes (form, factory) {
|
||||
var name = factory.getName(),
|
||||
types = factory.getTypes();
|
||||
@@ -296,6 +301,13 @@
|
||||
|
||||
$.extend(values, this.getValues());
|
||||
|
||||
if ($(root.clickedButton).attr('name') == 'task') {
|
||||
values.task = $(root.clickedButton).attr('value');
|
||||
if (values.task == 'saveas') {
|
||||
values.lang = $(root.clickedButton).attr('lang');
|
||||
}
|
||||
}
|
||||
|
||||
if (!values.task) {
|
||||
values.task = 'save';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user