Merge lp:~intellectronica/lazr-js/choiceedit-horizontal-position into lp:lazr-js

Proposed by Eleanor Berger on 2010-03-25
Status: Merged
Merged at revision: not available
Proposed branch: lp:~intellectronica/lazr-js/choiceedit-horizontal-position
Merge into: lp:lazr-js
Diff against target: 15 lines (+5/-0)
1 file modified
src-js/lazrjs/choiceedit/choiceedit.js (+5/-0)
To merge this branch: bzr merge lp:~intellectronica/lazr-js/choiceedit-horizontal-position
Reviewer Review Type Date Requested Status
Michael Nelson (community) code/ui 2010-03-25 Approve on 2010-03-25
Review via email: mp+22106@code.launchpad.net

Description of the Change

This branch corrects the placement of the choice edit widget so that it never draws itself in a horizontal position that would cause the page to require horizontal scrolling.

To post a comment you must log in.
Michael Nelson (michael.nelson) wrote :

Thanks Tom.

The new code does of course make it possible to put the choicelist off the screen on the left-hand side, but only when the browser width is less than the overlay, so no issue there :)

Thanks!

review: Approve (code/ui)
Michael Nelson (michael.nelson) wrote :

Actually on second thought, it would be good to actually test for that case, as you *don't* get a scroll bar in that case.

If someone accesses LP on a small screen device they'd not even be able to scroll to see the whole choicelist?

What do you think?

174. By Eleanor Berger on 2010-03-25

Don't correct the position if the client area is narrower than the widget.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src-js/lazrjs/choiceedit/choiceedit.js'
2--- src-js/lazrjs/choiceedit/choiceedit.js 2010-02-27 16:36:36 +0000
3+++ src-js/lazrjs/choiceedit/choiceedit.js 2010-03-25 10:56:31 +0000
4@@ -535,6 +535,11 @@
5 if (valueX < 0) {
6 valueX = 0;
7 }
8+ if ((valueX >
9+ document.body.clientWidth - boundingBox.get('offsetWidth')) &&
10+ (document.body.clientWidth > boundingBox.get('offsetWidth'))) {
11+ valueX = document.body.clientWidth - boundingBox.get('offsetWidth');
12+ }
13 if (valueY < 0) {
14 valueY = 0;
15 }

Subscribers

People subscribed via source and target branches