Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(dialog): fix dialog resizing on window resize
Browse files Browse the repository at this point in the history
The current resize listeners for the window are misplaced inside of the condition of `escapeToClose == true`.

Fixes #6876

  Closes #6878
  • Loading branch information
devversion authored and ThomasBurleson committed Jan 28, 2016
1 parent d963dca commit ae7d661
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,17 +746,23 @@ function MdDialogProvider($$interimElementProvider) {
// Add keydown listeners
element.on('keydown', keyHandlerFn);
target.on('keydown', keyHandlerFn);
window.on('resize', onWindowResize);

// Queue remove listeners function
removeListeners.push(function() {

element.off('keydown', keyHandlerFn);
target.off('keydown', keyHandlerFn);
window.off('resize', onWindowResize);

});
}

// Register listener to update dialog on window resize
window.on('resize', onWindowResize);

removeListeners.push(function() {
window.off('resize', onWindowResize);
});

if (options.clickOutsideToClose) {
var target = element;
var sourceElem;
Expand Down

0 comments on commit ae7d661

Please sign in to comment.