Commits

Alessandro Molina committed adcf0ff

Avoid error message when using ajaxforms to upload files due to form being loaded in an iframe where jQuery is not defined

Comments (0)

Files changed (1)

smallpress/templates/attachments.html

     ${ajaxform._ajaxform_display(value=value)}
 </div>
 <script>
+if (typeof jQuery != 'undefined') {
     jQuery('#${ajaxform_id}').find('form').ajaxForm({target:jQuery('#${ajaxform_id}').parent(),
         url:'${ajaxform_action}',
         beforeSubmit:function(arr, form, options) {
             jQuery('#${ajaxform_id}').append('<img class="spinner_icon" src="${ajaxform_spinner.link}"/>');
         }
     });
+}
 </script>
 </body>
 </html>