mozilla/treeherder-ui — pull request #129 by tojonmz (2014-08-22 17:01:14+00:00)
Title: Close job panel and unselect job when clicking empty area (1042711)

This work fixes Bugzilla bug [1042711](https://bugzilla.mozilla.org/show_bug.cgi?id=1042711).

If the user clicks in any empty space in the job panel that *isn't* another job, filter UI, result set link or other anchors, the job panel is closed and the selected job reverts to its unselected state. This mirrors TBPL's behavior. To support this, the overflow is hidden in the result set container, as it is in TBPL. This bypasses the problem [described here in the bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1042711#c2) by eliminating the result set scroll bar altogether. Ed has signed off on that .

For historical reference, this was [the only example](http://stackoverflow.com/questions/10045423/determine-whether-user-clicking-scrollbar-or-content-onclick-for-native-scroll) I could find of addressing that scroll bar issue, suppressing a scroll bar mouse event, using jQuery. It seemed involved for the added complexity and unknowns vs. functionality gain.

I pose we'd be better served by presenting the information in the result set container in a more compact way, or with improved layout, so that it would never overflow or require a scroll bar to begin with. But that's a separate topic. So, here is the new behavior:

Job selected, hover over a result set still shows the overflowing content

![jobselected](https://cloud.githubusercontent.com/assets/3660661/4013900/3f0c24ec-2a1b-11e4-9d33-12d999fcdd90.jpg)

Click event outside the job, deselects the job and closes the panel

![emptyspaceselected](https://cloud.githubusercontent.com/assets/3660661/4013912/62b93c22-2a1b-11e4-83a7-1217d0fd343f.jpg)

If you click on a link in the result set or elsewhere, the job selection is preserved and the job details panel remains open. As always, you just get your link opened in a new tab.

I've spent some time testing the various workflows, and I can't find any bad behaviors introduced by the change. I am not sure if I have done everything correctly w.r.t. the internal state of the job in the model or elsewhere, that would need to be checked. Sorry I am a newbie in that area, among many others :)

Tested on Windows:
FF Release **31.0**
Chrome Latest Release **36.0.1985.143 m**

Adding @maurodoglio and @camd for visibility.