Fix modalBox click handler to respect disabled state

The button's click event used to fire in a modalbox and destroy it, even when
the button is disabled. I added a check that the button is enabled before
firing the default click event in a modalbox.

Testing Done:
1. Click the button when it is disabled, the modalbox stays and doesn't get
   destroyed.
2. Select a file, click upload button, click event fires normally.

Bugs closed: 3338

Reviewed at https://reviews.reviewboard.org/r/5816/