Fix dirty handling and crashes with the comment dialog.
Fix dirty handling and crashes with the comment dialog.

Pressing control-enter to save a comment dialog would result in setting
the dialog as dirty. This happened because keyup would get the request
mid-flight while saving the comment, and would reset the flag back to dirty.

The process of updating the dirty flag would also trigger a window resize,
but the elements were going away (in the process of animating to invisible).
This could cause a JavaScript error. This seems to be local to Chrome.

Both of these issues would result in a "Are you sure you want to leave the
page?" if you pressed control-enter. In the first case, we'd be dirty.
In the second, we'd crash and had no chance of resetting back to 0 anyway.
Of course, in the second case, whole new problems could be hit.

The solution is to just specify that we're ignoring the key up event. This
is set/cleared on every key press, and we use it to determine if we're
going to ignore the keyup event.

We also don't trigger a resize if invisible.

sgallagher/reviewboard,beol/reviewboard,sgallagher/reviewboard,atagar/ReviewBoard,1tush/reviewboard,KnowNo/reviewboard,chipx86/reviewboard,chazy/reviewboard,chazy/reviewboard,1tush/reviewboard,atagar/ReviewBoard,1tush/reviewboard,bkochendorfer/reviewboard,bkochendorfer/reviewboard,atagar/ReviewBoard,KnowNo/reviewboard,reviewboard/reviewboard,custode/reviewboard,brennie/reviewboard,chazy/reviewboard,atagar/ReviewBoard,chazy/reviewboard,brennie/reviewboard,atagar/ReviewBoard,chazy/reviewboard,Khan/reviewboard,reviewboard/reviewboard,Khan/reviewboard,Khan/reviewboard,beol/reviewboard,KnowNo/reviewboard,chazy/reviewboard,custode/reviewboard,chazy/reviewboard,davidt/reviewboard,brennie/reviewboard,sgallagher/reviewboard,1tush/reviewboard,custode/reviewboard,atagar/ReviewBoard,bkochendorfer/reviewboard,davidt/reviewboard,atagar/ReviewBoard,Khan/reviewboard,Khan/reviewboard,chazy/reviewboard,sgallagher/reviewboard,chipx86/reviewboard,davidt/reviewboard,1tush/reviewboard,atagar/ReviewBoard,beol/reviewboard,1tush/reviewboard,1tush/reviewboard,1tush/reviewboard,reviewboard/reviewboard,chazy/reviewboard,Khan/reviewboard,Khan/reviewboard,bkochendorfer/reviewboard,1tush/reviewboard,brennie/reviewboard,davidt/reviewboard,beol/reviewboard,Khan/reviewboard,custode/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,Khan/reviewboard,chipx86/reviewboard,atagar/ReviewBoard,KnowNo/reviewboard