Partially reverted "Moved hiding top panel operation to JS"