jQuery Mobile Multipage Dialog Close bug

Demonstrates that when a JQM dialog is closed the entire document is reloaded and each pageinit is re-fired. Setps to reproduce: Open your browser debugging console (f12) Run the fiddle. Click the 'Show page "two"' Button Click the 'Back to page "one"' Button Click the 'Show page "popup" (as a dialog)' Button Click the 'Back to page "one"' Button When the dialog closes you will see the entire document reload and each pageinit is fired

by bizamajig

HTML

<!DOCTYPE html> 
<html> 

<head>
    <meta charset="utf-8">Reset
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>Multi-page template</title> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script type="text/javascript">
        $(document).bind("mobileinit", function ()
        {
            console.info('mobile init firing now!');
        });
    </script>
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
    <script type="text/javascript">
        $.mobile.pushStateEnabled = false;
        console.log('last line in the <head> has just been executed');
    </script>
</head> 

    
<body> 

<!-- Start of first page: #one -->
<div data-role="page" id="one">
<script type="text/javascript">
    $('#one').bind('pageinit', function (event)
    {
        console.log('page one init');
    });
</script>
    <div data-role="header">
        <h1>Multi-page</h1>
    </div><!-- /header -->

    <div data-role="content" >    
        <h2>One</h2>
        
        <p>I have an id of "one" on my page container. I'm first in the source order so I'm shown when the page loads.</p>    
        
        <p>This is a multi-page boilerplate template that you can copy to build you first jQuery Mobile page. This template contains multiple "page" containers inside, unlike a <a href="page-template.html"> single page template</a> that has just one page within it.</p>    
        <p>Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.</p>
        <p>You link to internal pages by referring to the ID of the page you want to show. For example, to <a href="#two" >link</a> to the page with an ID of "two", my link would have a...