Commits

Andriy Kornatskyy committed 9e443f8

Moved ajax form initialization into core.js.

Comments (0)

Files changed (7)

demos/template/content/static/js/core.js

 
 function ajaxForm(selector, dataType) {
     if (!dataType) dataType = 'json'
-    $(selector || 'input[type="submit"]').live('click', function(e) {
+    $(selector || 'input[type="submit"]:not(.noajax)').live('click', function(e) {
         submit = $(this);
         submit.attr('disabled', 'disabled');
         var form = submit.parents('form:first');
         return false;
     });
 }
+
+$(document).ready(function() {
+    ajaxForm();
+})

demos/template/content/templates-jinja2/membership/signin.html

 {% endblock %}
 {% block script %}
 <script type="text/javascript">
-    $(document).ready(function() {
-        ajaxForm();
-    })
 </script>
 {% endblock %}

demos/template/content/templates-jinja2/membership/signup.html

 {% endblock %}
 {% block script %}
 <script type="text/javascript">
-    $(document).ready(function() {
-        ajaxForm();
-     }})
 </script>
 {% endblock %}

demos/template/content/templates-mako/membership/signin.html

 </div>
 <%block name="script">
 <script type="text/javascript">
-    $(document).ready(function() {
-        ajaxForm();
-    })
 </script>
 </%block>

demos/template/content/templates-mako/membership/signup.html

 </div>
 <%block name="script">
 <script type="text/javascript">
-    $(document).ready(function() {
-        ajaxForm();
-    })
 </script>
 </%block>

demos/template/content/templates-tenjin/membership/signin.html

 </div>
 <?py for s in capture_as("script"): ?>
 <script type="text/javascript">
-    $(document).ready(function() {
-        ajaxForm();
-    })
 </script>
 <?py #endfor ?>

demos/template/content/templates-tenjin/membership/signup.html

 </div>
 <?py for s in capture_as("script"): ?>
 <script type="text/javascript">
-    $(document).ready(function() {
-        ajaxForm();
-    })
 </script>
 <?py #endfor ?>