Resize popup on orientation change

Resize popup on orientation change

Hello,

im developing an app for android. Inside the app i want to show the changelog inside a popup. On flipping the mobile device, the popup should resize to the available height.
Here is what i have.

index.html
  1. <div data-role="page" id="Changelog" data-iscroll="enable">
     
          <div data-role="header" data-theme="a">
              <h1>Changelog</h1>
          </div>
     
    	<div role="main" class="ui-content changelogdiag">
                  <div data-iscroll="scroller" class="ui-content changelogdiagscroll">		
    	       ......
                  </div>
    	</div>
    </div>

Inside the index.js i call the ResizeChangelogHeight on changing the orientation

  1. function doOnOrientationChange() {
    	try {
    	    //alert(activepage);
    		if (activepage == "Changelog") {
    			try {
    			    ResizeChangelogHeight();
    			} catch (e) {
    				alert(e);
    			}
    		}
    	} catch (e) {
    		alert(e);
    	}
    }
  2. function ResizeChangelogHeight() {
    	var docheight = $(window).height() - 150;
    	$('.changelogdiag').css({ 'height': docheight });
    	var docheight2 = $(window).height() - 200;
    	$('.changelogdiagscroll').css({ 'height': docheight2 });
    }

The strange thing is, that if i don't comment out the alert, it works, but otherwiese it doesn't. Any idea how i can force the dialog or the div's to update it's layout?

Many thanks in advance,
Michael