Moved popover hiding logic to PageController