opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

Dialog reappears on forward action (should be remove from history instead) #194

Open fluxi2 opened 11 years ago

fluxi2 commented 11 years ago

Hello,

i have a problem with the following sample code. When I click on "Show Dialog" the dialog appears. So good so far. Then I close the dialog und I go forward (through browser button or mouse key). Now I see the dialog again, but that isn't the expected behavior. Dialogs should be removed from history stack.

I used the latest version of jquery-mobile-angular-adapter.

Is it a bug or how can I solve the problem?

sample.html

  <!DOCTYPE html>
  <html ng-app="myApp">
  <head>
    <meta charset="utf-8"/>
    <title>Sample</title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.css"/>
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.js"></script>
    <script src="jquery-mobile-angular-adapter.js"></script>
    <script>
       var myAppModule = angular.module('myApp', []);
    </script>
  </head>
  <body>

  <div data-role="page" id="page1" data-fullscreen="true" data-title="Page 1">

    <div data-role="content">
      <a href="#dialog" data-transition="pop">Show Dialog</a>
    </div>
  </div>

  <div data-role="dialog" id="dialog">
    <div data-role="header">
      <h1>Dialog</h1>
    </div>
    <div data-role="content">
      Close this dialog and then forward again! This dialog will appear again.
    </div>
  </div>

  </body>
  </html>
tbosch commented 11 years ago

Hi, thanks! I double checked and your are right: Dialogs are not removed when trying to reach them using the forward button. Note: They are removed if the dialog is reached using the back button, see this fiddle: http://jsfiddle.net/jsBZh/1/

Tobias