1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

css_hook_css: Fix document.css.media change hook

When document.css.media is changed, make sure to call draw_formatted with rerender = 2 to force a more complete rerendering.
This commit is contained in:
Miciah Dashiel Butler Masters 2007-12-22 03:57:58 +00:00
parent 670d13728a
commit eb2db32f1e

View File

@ -183,17 +183,21 @@ import_default_css(void)
static int
change_hook_css(struct session *ses, struct option *current, struct option *changed)
{
if (!strcmp(changed->name, "stylesheet")
|| !strcmp(changed->name, "media")) {
int reload_css = 0;
if (!strcmp(changed->name, "stylesheet")) {
/** @todo TODO: We need to update all entries in
* format cache. --jonas */
import_default_css();
}
if (!strcmp(changed->name, "media"))
reload_css = 1;
/* Instead of using the value of the @ses parameter, iterate
* through the @sessions list. The parameter may be NULL and
* anyway we don't support session-specific options yet. */
foreach (ses, sessions) draw_formatted(ses, 1);
foreach (ses, sessions) draw_formatted(ses, 1 + reload_css);
return 0;
}