Hi, that JS is written from the time we supported old browser like IE6, that why we use JS to setup the DOM position.

I also think that we need to change the JS behaviour in this usecase. 
I've looked at the PR, I don't see any regression on this PR
But ony have 1 question, why do you keep it repositioning itself for horizontal scroll ? when the popup is open, it's positioned already, we don't need to care about it when we scroll the browser (the issue with vertical scroll can also happen with horizontal scroll)

One more thing, you added this snipet: 
browser.currWidth != jWin.width()
--> currWidth is not set anywhere, it's always undefined


On Tue, Jun 4, 2013 at 12:08 AM, Matt Wringe <mwringe@redhat.com> wrote:
On Fri 31 May 2013 10:31:59 AM EDT, Matt Wringe wrote:
> I take silence to mean acceptance :) I will submit a PR for this soon if
> I don't hear any objections.

https://github.com/gatein/gatein-portal/pull/515

> Thanks,
>
> Matt Wringe
>
> On 29/05/13 11:44 AM, Matt Wringe wrote:
>> The current behaviour of how the classic site handles modals (eg popups)
>> doesn't work well on mobile or touch based devices.
>>
>> On the classic site, the modals are positioned on the page via
>> javascript and are configured to center the content when the browser
>> window's size has changed or a scroll event has occurred.
>>
>> On mobile devices, when entering a form the device will scroll the page
>> to make room for the on-screen keyboard.
>>
>> When a mobile device accesses a modal on the classic site, the page gets
>> scrolled via the browser for the on-screen keyboard and then the
>> portal's javascript will re-position the modal due to this scroll. This
>> modal is then always hidden behind the keyboard and it becomes unusuable.
>>
>> A fix would be to remove the vertical movement during a scroll. The
>> horizonal movement will still exist and the modal is centered on the
>> page when it is first created, but it will no longer reposition itself
>> vertically afterwards. Since this is a behaviour change (and could be
>> reviewed as a feature regression) and I asking what people's thoughts
>> are on this and if people have a different idea on how to handle it.
>>
>> jira: https://issues.jboss.org/browse/GTNPORTAL-3079
>> branch which remove vertical movement on scroll:
>> https://github.com/mwringe/gatein-portal/tree/GTNPORTAL-3079
>>
>> Thanks,
>>
>> Matt Wringe
>>
>> NB: the mobile site does something different with all of this and uses a
>> purely css based solution to center the content horizontally and
>> vertically, but this solution doesn't work nicely with the fixed layout
>> of the classic site.
>> _______________________________________________
>> gatein-dev mailing list
>> gatein-dev@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/gatein-dev
>
> _______________________________________________
> gatein-dev mailing list
> gatein-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/gatein-dev


_______________________________________________
gatein-dev mailing list
gatein-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/gatein-dev