Merge lp:~intellectronica/lazr-js/choiceedit-position into lp:lazr-js
| Status: | Merged |
|---|---|
| Merged at revision: | not available |
| Proposed branch: | lp:~intellectronica/lazr-js/choiceedit-position |
| Merge into: | lp:lazr-js |
| Diff against target: |
17 lines (+5/-1) 1 file modified
src-js/lazrjs/choiceedit/choiceedit.js (+5/-1) |
| To merge this branch: | bzr merge lp:~intellectronica/lazr-js/choiceedit-position |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Nelson (community) | code ui | 2010-02-23 | Approve on 2010-02-23 |
|
Review via email:
|
|||
| Eleanor Berger (intellectronica) wrote : | # |
- 170. By Eleanor Berger on 2010-02-23
-
Use a selector instead of iterating over many items.
| Michael Nelson (michael.nelson) wrote : | # |
That's an excellent improvement for lots of situations Tom. I can't see any way to handle the situation where the box would be outside the viewable area either (other than moving the user's cursor ;)).
One possibility: if we always presented the current item at the top of the widget, with the available options below, we could guarantee that both the current item was under the mouse and the other options were visible (except at the bottom of the page where we'd hit the same issue, but I think that situation would be much less frequent). Thoughts?
14:10 < noodles775> intellectronica: code-wise, any reason for not using boundingBox.
14:10 < intellectronica> noodles775: no, i just didn't think of that. let me give that a try.
14:12 < intellectronica> noodles775: yeah, that works fine. changing.
14:13 < noodles775> Great, r=me.
14:13 < intellectronica> noodles775: thanks!

This branch changes the positioning of the ChoiceEdit control so that the currently selected item is positioned directly under the mouse. This behaviour is more predictable, and we intended to implement it that way originally, but didn't do it because we were hoping that YUI will eventually provide a convenient way to do that. This never happened, and as part of my fix for bug #412925 I just went ahead and implemented it this way (with not much code anyway). The exception to the rule remains that if to position the box correctly will require drawing some of it outside of the viewable area, the position is corrected. I think that's an acceptable compromise, since drawing some of the items out of the screen will be a serious usability problem.