variable width user-dropdown

This commit is contained in:
Westly Wright 2018-05-01 15:58:22 -07:00
parent f7b5409cf9
commit f8dadaaf16
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
5 changed files with 11 additions and 6 deletions

View File

@ -31,8 +31,7 @@ $dropdown-caret-color : $mid-grey !default;
left: auto;
display: none; // none by default, but block on "open" of the menu
float: left;
min-width: 200px;
max-width: 400px;
max-width: 100vw;
padding: 0;
margin: 0; // override default ul
list-style: none;

View File

@ -1,4 +1,5 @@
$gh-block-color: $text-color;
$size: 35px;
.gh-block-list {
margin-bottom: 0;
@ -13,8 +14,12 @@ $gh-block-color: $text-color;
}
.gh-block {
width: calc(100% + #{$size});
white-space: nowrap;
.gh-block-content {
line-height: initial;
margin-right: 35px; // temp but adds space for non-existent floated avatar
}
.gh-avatar {
@ -42,7 +47,6 @@ $gh-block-color: $text-color;
}
}
$size: 35px;
.gh-avatar {
width: $size;

View File

@ -20,7 +20,7 @@
{{/if}}
<div class="gh-block-content">
<div class="clip gh-block-name">
<div class="gh-block-name">
{{#if loading}}
{{t 'identityBlock.loading'}}
{{else}}
@ -28,7 +28,9 @@
<a href="{{principal.profileURL}}" target="_blank">{{login}}</a>
{{else}}
{{#if principal.displayName}}
{{principal.displayName}} <small>(&nbsp;{{principal.loginName}}&nbsp;)</small>
<div>
{{principal.displayName}} {{#if principal.loginName }}<small>(&nbsp;{{principal.loginName}}&nbsp;)</small>{{/if}}
</div>
{{else if principal.loginName}}
{{principal.loginName}}
{{else}}

View File

@ -247,6 +247,7 @@ export default Mixin.create({
},
showMenu: function(el, drpd, offset) {
drpd.css({width: drpd.width()});
drpd.addClass('invisible');
drpd.addClass('block');
positionDropdown(drpd, el, drpd.hasClass('dropdown-menu-right'), offset);

View File

@ -12,7 +12,6 @@
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;