git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 07d92acf authored by mmn's avatar mmn

Fix "unique notice form ID" code for reply forms

parent ef1f17fc
......@@ -224,7 +224,16 @@ var SN = { // StatusNet
var newId = 'form_notice_' + Math.floor(Math.random()*999999999);
var attrs = ['name', 'for', 'id'];
for (var key in attrs) {
form.find("[" + attrs[key] + "~='" + oldId + "']").each(function () {
if (form.attr(attrs[key]) === undefined) {
continue;
}
form.attr(attrs[key], form.attr(attrs[key]).replace(oldId, newId));
}
for (var key in attrs) {
form.find("[" + attrs[key] + "*='" + oldId + "']").each(function () {
if ($(this).attr(attrs[key]) === undefined) {
return; // since we're inside the each(function () { ... });
}
var newAttr = $(this).attr(attrs[key]).replace(oldId, newId);
$(this).attr(attrs[key], newAttr);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment