Javascript bugfixes

This commit is contained in:
KeyserSosa
2009-03-19 13:40:05 -07:00
parent b78ad24dc8
commit 1b782c28e3
2 changed files with 8 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ function post_form(form, where, statusfunc, nametransformfunc, block) {
}
};
function simple_post_form(form, where, fields, block) {
function get_form_fields(form, fields) {
fields = fields || {};
/* consolidate the form's inputs for submission */
$(form).find("select, input, textarea").not(".gray").each(function() {
@@ -65,8 +65,11 @@ function simple_post_form(form, where, fields, block) {
if (fields.id == null) {
fields.id = $(form).attr("id") ? ("#" + $(form).attr("id")) : "";
}
return fields;
};
$.request(where, fields, null, block);
function simple_post_form(form, where, fields, block) {
$.request(where, get_form_fields(form, fields), null, block);
return false;
};

View File

@@ -347,6 +347,8 @@ ${unsafe(txt)}
post_site: "${c.site.name if not c.default_sr else ''}",
/* are we in an iframe */
cnameframe: ${"true" if (c.cname and not c.authorized_cname) else "false"},
/* this page's referer" */
referer: "${request.referer or ""}",
/* the user's voting hash */
modhash: ${"'%s'" % c.modhash or "false"},
/* current domain */
@@ -368,7 +370,7 @@ ${unsafe(txt)}
<%def name="logout()">
<form method="post" action="/logout" class="logout hover">
<input type="hidden" name="uh" value="${c.modhash}"/>
<a href="javascript:void()" onclick="$(this).parent().submit()">
<a href="javascript:void(0)" onclick="$(this).parent().submit()">
${_("logout")}
</a>
</form>