Browse Source

Fix Contrib share dynamic form

opi 10 years ago
parent
commit
c8deb5542e
1 changed files with 5 additions and 9 deletions
  1. 5 9
      assets/main.js

+ 5 - 9
assets/main.js

@@ -62,15 +62,11 @@ $( document ).ready(function() {
 
 
     // Contrib share dynamic form
-    $('#contrib-type-share').hide();
-    $('[name="contrib-type"').change(function(e){
-        console.log($(this).val());
-        if ($(this).val() == 'share') {
-            $('#contrib-type-share').slideDown();
-        }
-        else {
-            $('#contrib-type-share').slideUp();
-        }
+    if ($('[name="contrib-type"]').val() == 'share') { $('#contrib-type-share').show(); }
+    else { $('#contrib-type-share').hide(); }
+    $('[name="contrib-type"]').change(function(e){
+        if ($(this).val() == 'share') { $('#contrib-type-share').slideDown(); }
+        else { $('#contrib-type-share').slideUp(); }
     });
 
 });