Perhaps I did not understand you. I should remove the prefDef = false statements and use preventDefault instead in the needed cases, right?

Currently we use event.preventDefault(); in eight of  ten cases.