Poll plugin: make the polling response form submit via AJAX and return the results.
Now, any form marked with 'ajax' class will get the simple FormXHR treatment. Should help cut down on code that just adds that into individual forms.
This commit is contained in:
11
js/util.js
11
js/util.js
@@ -1380,6 +1380,16 @@ var SN = { // StatusNet
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Set up any generic 'ajax' form so it submits via AJAX with auto-replacement.
|
||||
*/
|
||||
AjaxForms: function() {
|
||||
$('form.ajax').live('submit', function() {
|
||||
SN.U.FormXHR($(this));
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Add logic to any file upload forms to handle file size limits,
|
||||
* on browsers that support basic FileAPI.
|
||||
@@ -1416,6 +1426,7 @@ var SN = { // StatusNet
|
||||
* don't start them loading until after DOM-ready time!
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
SN.Init.AjaxForms();
|
||||
SN.Init.UploadForms();
|
||||
if ($('.'+SN.C.S.FormNotice).length > 0) {
|
||||
SN.Init.NoticeForm();
|
||||
|
Reference in New Issue
Block a user