wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lucio Crusca <lu...@sulweb.org>
Subject Re: ModalWindow positioning
Date Wed, 25 Jun 2014 16:05:54 GMT
I always forget I should not change the subject, sorry... I send the message 
again with the unchanged subject so that it remains attached to the rest of 
this thread.

In data mercoledì 25 giugno 2014 14:54:23, Martin Grigorov ha scritto:
> also try: this.window

Ok thanks, "this.window" seems to be the correct one in my case, but I suspect 
other variants are needed to be as much cross browser as possible.

Just in case others need it, my current working code is:

Wicket.Window.prototype.center = function() {
  var myWindow = this.window;
  if (!myWindow)
    myWindow = Wicket.Window.current;
  if (!myWindow)
    myWindow = Wicket.Window.get();
  if (myWindow) {
    $(myWindow).css("position", "fixed");
    $(myWindow).css("top", Math.max(0, ((window.innerHeight - 
$(myWindow).outerHeight) / 2)) + "px");
    $(myWindow).css("left", Math.max(0, ((window.innerWidth - 
$(myWindow).outerWidth) / 2)) + "px");
  }
}; 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message