after save content redirect to the proper tab to avoid confusion if the content was created or not #1541
This commit is contained in:
parent
437190fcbb
commit
49fb7f03b1
1 changed files with 5 additions and 0 deletions
|
@ -466,18 +466,23 @@ foreach ($customFields as $field => $options) {
|
||||||
|
|
||||||
// Button Save
|
// Button Save
|
||||||
$("#jsbuttonSave").on("click", function() {
|
$("#jsbuttonSave").on("click", function() {
|
||||||
|
let actionParameters = '';
|
||||||
|
|
||||||
// If the switch is setted to "published", get the value from the selector
|
// If the switch is setted to "published", get the value from the selector
|
||||||
if ($("#jsbuttonSwitch").data("switch") == "publish") {
|
if ($("#jsbuttonSwitch").data("switch") == "publish") {
|
||||||
var value = $("#jstypeSelector option:selected").val();
|
var value = $("#jstypeSelector option:selected").val();
|
||||||
$("#jstype").val(value);
|
$("#jstype").val(value);
|
||||||
|
actionParameters = '#' + value;
|
||||||
} else {
|
} else {
|
||||||
$("#jstype").val("draft");
|
$("#jstype").val("draft");
|
||||||
|
actionParameters = '#draft';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the content
|
// Get the content
|
||||||
$("#jscontent").val(editorGetContent());
|
$("#jscontent").val(editorGetContent());
|
||||||
|
|
||||||
// Submit the form
|
// Submit the form
|
||||||
|
$("#jsform").attr('action', actionParameters);
|
||||||
$("#jsform").submit();
|
$("#jsform").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue