better behaviour of permalink and map buttons (closes #1188)