[ 
https://issues.apache.org/jira/browse/WICKET-2254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903157#action_12903157
 ] 

Hudson commented on WICKET-2254:
--------------------------------

Integrated in Apache Wicket 1.5.x #269 (See 
[https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/269/])
    

> ModalWindow size may exceed browser viewport making it impossible to close
> --------------------------------------------------------------------------
>
>                 Key: WICKET-2254
>                 URL: https://issues.apache.org/jira/browse/WICKET-2254
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.6
>            Reporter: Per Cederberg
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.11, 1.5-M2
>
>
> If a modal window is created with a size that is larger than what is 
> available in the browser viewport, the user will be unable to close the 
> window. The close button is displayed over the top of the window, making it 
> impossible to reach.
> The problem lies in the center() function inside modal.js and is easy enough 
> to fix:
> +    // BUGFIX: Adjust the width and height to maximum values
> +    if (modalWidth > width - 10) {
> +       this.window.style.width = (width - 10) + "px";
> +        modalWidth = this.window.offsetWidth;
> +    }
> +    if (modalHeight > height - 40) {
> +       this.content.style.height = (height - 40) + "px";
> +        modalHeight = this.window.offsetHeight;
> +    }
>       var left = (width / 2) - (modalWidth / 2) + scLeft;
>       var top = (height / 2) - (modalHeight / 2) + scTop;
> +    // BUGFIX: Ensure positive position values
> +    this.window.style.left = Math.max(left, 0) + "px";
> +    this.window.style.top = Math.max(top, 0) + "px";
> Note that the above code also ensures that the window position is positive at 
> all times.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to