Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOZ specific dropdown fix #13

Merged
merged 1 commit into from
Nov 30, 2016
Merged
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
32 changes: 32 additions & 0 deletions rd_ui/app/styles/redash.css
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ to add those CSS styles here. */
display: block;
}

.dashboards .dropdown-submenu:hover > .dropdown-menu {
display: flex;
}

.dropdown-submenu > a:after {
display: block;
content: " ";
Expand Down Expand Up @@ -273,6 +277,34 @@ to add those CSS styles here. */
border-radius: 6px 0 6px 6px;
}

.dashboards .dropdown-menu {
align-items: flex-start;
flex-direction: column;
flex-wrap: wrap;
justify-content: flex-start;
max-height: 500px;
}

.dashboards.open > .dropdown-menu {
display: flex;
}

.dashboards > .dropdown-menu {
width: 80vw;
Copy link
Member

Choose a reason for hiding this comment

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

IE support for viewport units like vw looks pretty 💩, is that ok?

Copy link
Author

Choose a reason for hiding this comment

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

For us it should be OK - ideally this would only be up for a few weeks before the upstreamed fix is in, % doesn't work as well because of the parent elm

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I'm cool with this change if you want to merge it.

align-items: flex-start;
}

.dashboards .dropdown-menu > li a {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.dashboards .dropdown-menu > li a,
.dashboards .dropdown-submenu > a {
width: 20vw;
}

.rd-tab .remove {
cursor: pointer;
color: #A09797;
Expand Down
8 changes: 4 additions & 4 deletions rd_ui/app/views/app_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="dropdown"
<li class="dropdown dashboards"
ng-show="groupedDashboards.length > 0 || otherDashboards.length > 0 || currentUser.hasPermission('create_dashboard')"
dropdown>
<a href="#" class="dropdown-toggle" dropdown-toggle title="Dashboards">
Expand All @@ -21,16 +21,16 @@
<ul class="dropdown-menu" dropdown-menu>
<span ng-repeat="(name, group) in groupedDashboards">
<li class="dropdown-submenu">
<a href="#" ng-bind="name"></a>
<a href="#" title="{{name}}" ng-bind="name"></a>
<ul class="dropdown-menu">
<li ng-repeat="dashboard in group" role="presentation">
<a role="menu-item" ng-href="dashboard/{{dashboard.slug}}" ng-bind="dashboard.name"></a>
<a role="menu-item" title="{{dashboard.name}}" ng-href="dashboard/{{dashboard.slug}}" ng-bind="dashboard.name"></a>
</li>
</ul>
</li>
</span>
<li ng-repeat="dashboard in otherDashboards">
<a role="menu-item" ng-href="dashboard/{{dashboard.slug}}" ng-bind="dashboard.name"></a>
<a role="menu-item" title="{{dashboard.name}}" ng-href="dashboard/{{dashboard.slug}}" ng-bind="dashboard.name"></a>
</li>
<li class="divider"
ng-show="currentUser.hasPermission('create_dashboard') && (groupedDashboards.length > 0 || otherDashboards.length > 0)"></li>
Expand Down