enable/disable context menu entries correctly according to currently selected element