Note that there are some explanatory texts on larger screens.

plurals
  1. POAngular UI Dialog - Closing and Reopening from Dialog causes Background
    primarykey
    data
    text
    <p>I am trying to close and reopen a dialog from the actual dialog controller's view. What ends up happening is that after dialog close/open, it won't properly close again. Escape works on some browsers (but the overlay remains) and clicking the background may cause the dialog to close but the overlay will remain (browser dependant). </p> <p>Question: How can I close/reopen a dialog from a function/button/event on the dialog's controller and that the dialog's close works properly (on escape or clicking background).</p> <p>The demo below is just a boiled down sample that demonstrates the issue as I will be doing a next/prev and I'd like to close/open on those clicks but am having this issue with not being able to exit the modal. </p> <p>Here is the online demo: <a href="http://plnkr.co/h8djNiSlH6c7d8SNzMmb" rel="nofollow">http://plnkr.co/h8djNiSlH6c7d8SNzMmb</a></p> <ol> <li>Open dialog</li> <li>Close dialog - works fine except IE (another issue).</li> <li>Open dialog</li> <li>Click button inside dialog to close/reopen</li> <li>Try to close the dialog</li> </ol> <p>Controllers:</p> <pre><code>function PopupCtrl($scope, $dialog, dialog, item, Utils) { $scope.items = Utils.getItems(); $scope.item = item; $scope.reOpen = function (item) { item = $scope.items[1]; dialog.close(); var d = $dialog.dialog({ dialogFade: true, backdropClick: true, dialogOpenClass: 'modal-open', resolve: { item: function () { return angular.copy(item) } } }); d.open('dialog.html', 'PopupCtrl'); }; } function MainCtrl($scope, $window, $dialog, $location, $timeout, Utils) { $scope.items = Utils.getItems(); $scope.openDialog = function (item) { item = $scope.items[0]; var d = $dialog.dialog({ dialogFade: true, dialogOpenClass: 'modal-open', resolve: { item: function () { return angular.copy(item) } } }); d.open('dialog.html', 'PopupCtrl'); }; } </code></pre> <p>I've tried this with angular bootstrap v0.2.0 and v.0.3.0 so it is either a bug or there is something I am missing with regards to how I am coding the logic.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload