Add a directive for keeping track of scroll state.