code revamp.

Signed-off-by: Horváth Balázs <qqroach@riftworks.org>
Apply media stuff after pjax events.

Signed-off-by: Horváth Balázs <qqroach@riftworks.org>