Make sure header is rendered before binding events to it

If JavaScript is not loaded at top the event is not
binded

Change-Id: I565d9cd49de4c584e5c9819d89e8e3f6fccf76ae