Pārlūkot izejas kodu

Do not send request if no type specified

Denis K 9 gadi atpakaļ
vecāks
revīzija
87590d6cf5
2 mainītis faili ar 15 papildinājumiem un 13 dzēšanām
  1. 15 13
      jet/static/jet/js/main.js
  2. 0 0
      jet/static/jet/js/main.min.js

+ 15 - 13
jet/static/jet/js/main.js

@@ -781,21 +781,23 @@
                 var $typeInput = $form.find('[name="type"]');
                 var type = $form.find('[name="module"] option:selected').data('type');
 
-                $typeInput.val(type);
+                if (type) {
+                    $typeInput.val(type);
 
-                $.ajax({
-                    url: $form.attr('action'),
-                    method: $form.attr('method'),
-                    dataType: 'json',
-                    data: $form.serialize(),
-                    success: function (result) {
-                        if (result.error) {
-                            return;
-                        }
+                    $.ajax({
+                        url: $form.attr('action'),
+                        method: $form.attr('method'),
+                        dataType: 'json',
+                        data: $form.serialize(),
+                        success: function (result) {
+                            if (result.error) {
+                                return;
+                            }
 
-                        document.location = result.success_url;
-                    }
-                });
+                            document.location = result.success_url;
+                        }
+                    });
+                }
 
                 e.preventDefault();
             });

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
jet/static/jet/js/main.min.js


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels