1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

domain rules style updates

This commit is contained in:
Kyle Spearrin
2017-04-15 01:00:25 -04:00
parent cdc06a2b49
commit 6825967cb9
3 changed files with 70 additions and 41 deletions

View File

@@ -54,7 +54,8 @@ angular
// Append dropdown menus to body
var bodyScrollbarWidth,
bodyDropdownMenu;
bodyDropdownMenu,
bodyDropdownMenuParent;
var dropdownHelpers = {
scrollbarWidth: function () {
if (!bodyScrollbarWidth) {
@@ -76,7 +77,7 @@ angular
};
$(window).on('show.bs.dropdown', function (e) {
var target = $(e.target);
var target = bodyDropdownMenuParent = $(e.target);
if (!target.hasClass('dropdown-to-body')) {
return true;
}
@@ -110,12 +111,24 @@ angular
});
$(window).on('hide.bs.dropdown', function (e) {
var target = $(e.target);
if (!target.hasClass('dropdown-to-body')) {
if (!bodyDropdownMenu) {
return true;
}
target.append(bodyDropdownMenu.detach());
$(e.target).append(bodyDropdownMenu.detach());
bodyDropdownMenu.hide();
bodyDropdownMenu = null;
bodyDropdownMenuParent = null;
});
$scope.$on('removeBodyDropdownMenu', function (event, args) {
if (!bodyDropdownMenu && !bodyDropdownMenuParent) {
return true;
}
bodyDropdownMenuParent.append(bodyDropdownMenu.detach());
bodyDropdownMenu.hide();
bodyDropdownMenu = null;
bodyDropdownMenuParent = null;
});
});