Просмотр исходного кода

after save content redirect to the proper tab to avoid confusion if the content was created or not #1541

Diego Najar 1 год назад
Родитель
Сommit
49fb7f03b1
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      bl-kernel/admin/views/new-content.php

+ 5 - 0
bl-kernel/admin/views/new-content.php

@@ -466,18 +466,23 @@ foreach ($customFields as $field => $options) {
 
 		// Button Save
 		$("#jsbuttonSave").on("click", function() {
+			let actionParameters = '';
+
 			// If the switch is setted to "published", get the value from the selector
 			if ($("#jsbuttonSwitch").data("switch") == "publish") {
 				var value = $("#jstypeSelector option:selected").val();
 				$("#jstype").val(value);
+				actionParameters = '#' + value;
 			} else {
 				$("#jstype").val("draft");
+				actionParameters = '#draft';
 			}
 
 			// Get the content
 			$("#jscontent").val(editorGetContent());
 
 			// Submit the form
+			$("#jsform").attr('action', actionParameters);
 			$("#jsform").submit();
 		});