fix #931 - tricky javascript to keep category dropdowns in view