myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (TOBAGO-1388) Wandering popup
Date Fri, 02 May 2014 17:17:47 GMT

    [ https://issues.apache.org/jira/browse/TOBAGO-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13987959#comment-13987959
] 

Hudson commented on TOBAGO-1388:
--------------------------------

FAILURE: Integrated in tobago-trunk #1173 (See [https://builds.apache.org/job/tobago-trunk/1173/])
TOBAGO-1388: Wandering popup (lofwyr: http://svn.apache.org/viewvc/?view=rev&rev=1589735)
* /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js


> Wandering popup
> ---------------
>
>                 Key: TOBAGO-1388
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-1388
>             Project: MyFaces Tobago
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-1
>         Environment: Custom Theme
>            Reporter: Bernhard Stadler
>            Assignee: Udo Schnurpfeil
>             Fix For: 2.0.0-beta-3
>
>         Attachments: PopupTestModel.java, popuptabletest.xhtml
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I have a tc:page containing a tc:popup with a tc:sheet inside. For the sheet, paging
is enabled. I'll attach an example.
> Every time the page is changed, the popup changes its position for some amount. 
> We have a custom theme and I was able to isolate the following definitions in our tobago.css
file which lay open the problem:
> {code}
> .tobago-page {
>     border: 1px solid #EEEEEE;
>     width: 90%;
>     height: 99%;
>     // ...
> }
> {code}
> Each of these lines alone causes some amount of popup movement. Removing all of them
makes the problem disappear.
> I also was able to isolate the JavaScript code where the actual repositioning happens:
tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js
Tobago.Utils.keepElementInVisibleArea line 98f (SVN trunk):
> {code}
> /**
>  * fix position, when the element it is outside of the current page
>  * @param elements is an jQuery Array of elements to be fixed.
>  */
> Tobago.Utils.keepElementInVisibleArea = function(elements) {
>   elements.each(function() {
>     var element = jQuery(this);
>     var page = jQuery(".tobago-page-content:first");
>     var left = element.offset().left;
>     var top = element.offset().top;
>     // fix menu position, when it is outside of the current page
>     left = Math.max(0, Math.min(left, page.outerWidth() - element.outerWidth()));
>     top = Math.max(0, Math.min(top, page.outerHeight() - element.outerHeight()));
>     element.css('left', left);
>     element.css('top', top);
>   });
> };
> {code}
> The "left" and "top" variables are not changed by the max/min assignment, but because
of (both!) the border and the changed width of the tobago-page class, element.offset().left
and element.offset().top seem to return a different value than actually needed. Even the following
code causes the same behavior:
> {code}
> Tobago.Utils.keepElementInVisibleArea = function(elements) {
>   elements.each(function() {
>     var element = jQuery(this);
>     element.css('left', element.offset().left);
>     element.css('top', element.offset().top);
>   });
> };
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message