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:
parent
670d13728a
commit
eb2db32f1e
@ -183,17 +183,21 @@ import_default_css(void)
|
|||||||
static int
|
static int
|
||||||
change_hook_css(struct session *ses, struct option *current, struct option *changed)
|
change_hook_css(struct session *ses, struct option *current, struct option *changed)
|
||||||
{
|
{
|
||||||
if (!strcmp(changed->name, "stylesheet")
|
int reload_css = 0;
|
||||||
|| !strcmp(changed->name, "media")) {
|
|
||||||
|
if (!strcmp(changed->name, "stylesheet")) {
|
||||||
/** @todo TODO: We need to update all entries in
|
/** @todo TODO: We need to update all entries in
|
||||||
* format cache. --jonas */
|
* format cache. --jonas */
|
||||||
import_default_css();
|
import_default_css();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcmp(changed->name, "media"))
|
||||||
|
reload_css = 1;
|
||||||
|
|
||||||
/* Instead of using the value of the @ses parameter, iterate
|
/* Instead of using the value of the @ses parameter, iterate
|
||||||
* through the @sessions list. The parameter may be NULL and
|
* through the @sessions list. The parameter may be NULL and
|
||||||
* anyway we don't support session-specific options yet. */
|
* 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user