Andriy Kornatskyy avatar 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 ?>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.