also try: this.window Martin Grigorov Wicket Training and Consulting
On Wed, Jun 25, 2014 at 2:53 PM, Martin Grigorov <mgrigo...@apache.org> wrote: > try with Wicket.Window.current > > Martin Grigorov > Wicket Training and Consulting > > > On Wed, Jun 25, 2014 at 2:51 PM, Lucio Crusca <lu...@sulweb.org> wrote: > >> In data mercoledì 25 giugno 2014 11:09:42, Martin Grigorov ha scritto: >> > Make sure that your code appears *after* the <script >> src=".../modal.js">. >> > With the browser Dev Tools you can put a breakpoint inside your function >> > and see whether it is called/used. >> >> I couldn't manage to set a breakpoint with Firebug, so I added two >> window.alert(). The first, before the "if", gets hit, not the second, so >> now I >> wonder what's the code that is centering the window, since my code is >> executed >> but it does absolutely nothing... >> >> And, I obviously don't know what to write instead of Wicket.Window.get() >> in >> order to make the "if" condition true. >> >> Wicket.Window.prototype.center = function() { >> window.alert("!!"); >> var myWindow = Wicket.Window.get(); >> if (myWindow) { >> window.alert("!!!!"); >> myWindow.css("position", "fixed"); >> myWindow.css("top", Math.max(0, (($(window).height() - >> $(myWindow).outerHeight()) / 2)) + "px"); >> myWindow.css("left", Math.max(0, (($(window).width() - >> $(myWindow).outerWidth()) / 2)) + "px"); >> } >> }; >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >