Disable any element with the class '.disabled', not only anchors

To make it work for buttons, specially.
Fix the ok button in the confirmation dialog after b5a89c16dbb9

A big part of the old code that was removed was actually necessary. Added it
back, reorganizing a bit.