mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Fix left border appearing on messages in Firefox
The problem seems to be caused by a bug in Firefox. We work around the issue by adding empty table rows to the top of the table and removing them when the user is idle. This resolves trac #413 (imported from commit 2b15a4a2241bd7e813800a42608d650e0d4fa4f0)
This commit is contained in:
@@ -384,6 +384,21 @@ function add_to_table(messages, table_name, filter_function, where, allow_collap
|
|||||||
table.find('.ztable_layout_row').after(rendered_elems);
|
table.find('.ztable_layout_row').after(rendered_elems);
|
||||||
} else {
|
} else {
|
||||||
table.append(rendered_elems);
|
table.append(rendered_elems);
|
||||||
|
|
||||||
|
// XXX: This is absolutely awful. There is a firefox bug
|
||||||
|
// where when table rows as DOM elements are appended (as
|
||||||
|
// opposed to as a string) a border is sometimes added to the
|
||||||
|
// row. This border goes away if we add a dummy row to the
|
||||||
|
// top of the table (it doesn't go away on any reflow,
|
||||||
|
// though, as resizing the window doesn't make them go away).
|
||||||
|
// So, we add an empty row and then garbage collect them
|
||||||
|
// later when the user is idle.
|
||||||
|
var dummy = $("<tr></tr>");
|
||||||
|
table.find('.ztable_layout_row').after(dummy);
|
||||||
|
$(document).idle({'idle': 1000*10,
|
||||||
|
'onIdle': function () {
|
||||||
|
dummy.remove();
|
||||||
|
}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user