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

fix(dialog, menu, select, interimElement): use $animateCss #3946

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/backdrop/backdrop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ md-backdrop {
}
&.md-select-backdrop {
z-index: $z-index-dialog + 1;
transition-duration: 0ms;
}
&.md-dialog-backdrop {
z-index: $z-index-dialog - 1;
Expand Down
10 changes: 6 additions & 4 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,6 @@ function MdDialogProvider($$interimElementProvider) {
// In case the user provides a raw dom element, always wrap it in jqLite
options.parent = angular.element(options.parent || $rootElement);

if (options.disableParentScroll) {
options.restoreScroll = $mdUtil.disableScrollAround(element,options.parent);
}
}

/**
Expand Down Expand Up @@ -610,6 +607,10 @@ function MdDialogProvider($$interimElementProvider) {
$animate.enter(options.backdrop, options.parent);
}

if (options.disableParentScroll) {
options.restoreScroll = $mdUtil.disableScrollAround(element,options.parent);
}

/**
* Hide modal backdrop element...
*/
Expand All @@ -619,9 +620,10 @@ function MdDialogProvider($$interimElementProvider) {
}
if (options.disableParentScroll) {
options.restoreScroll();
delete options.restoreScroll;
}

options.hideBackdrop = null;
delete options.hideBackdrop;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment saying why you are using delete instead of setting to null? (since the latter is generally much faster)

}
}

Expand Down
Loading