Commit 46ab09ed by Torkel Ödegaard

feat(links): fixed styling for dashboard links

parent dc3b6147
...@@ -13,11 +13,14 @@ ...@@ -13,11 +13,14 @@
<div ng-repeat="annotation in ctrl.dashboard.annotations.list" class="submenu-item" ng-class="{'annotation-disabled': !annotation.enable}"> <div ng-repeat="annotation in ctrl.dashboard.annotations.list" class="submenu-item" ng-class="{'annotation-disabled': !annotation.enable}">
<gf-form-switch class="gf-form" label="{{annotation.name}}" checked="annotation.enable" on-change="ctrl.annotationStateChanged()"></gf-form-switch> <gf-form-switch class="gf-form" label="{{annotation.name}}" checked="annotation.enable" on-change="ctrl.annotationStateChanged()"></gf-form-switch>
</div> </div>
</ul> </div>
<div class="gf-form gf-form--grow">
</div>
<ul class="pull-right" ng-if="ctrl.dashboard.links.length > 0"> <div ng-if="ctrl.dashboard.links.length > 0" >
<dash-links-container links="ctrl.dashboard.links"></dash-links-container> <dash-links-container links="ctrl.dashboard.links" class="gf-form-inline"></dash-links-container>
</ul> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
...@@ -44,17 +44,19 @@ function (angular, _) { ...@@ -44,17 +44,19 @@ function (angular, _) {
restrict: 'E', restrict: 'E',
link: function(scope, elem) { link: function(scope, elem) {
var link = scope.link; var link = scope.link;
var template = '<div class="submenu-item dropdown">' + var template = '<div class="gf-form">' +
'<a class="pointer dash-nav-link" data-placement="bottom"' + '<a class="pointer gf-form-label" data-placement="bottom"' +
(link.asDropdown ? ' ng-click="fillDropdown(link)" data-toggle="dropdown"' : "") + '>' + (link.asDropdown ? ' ng-click="fillDropdown(link)" data-toggle="dropdown"' : "") + '>' +
'<i></i> <span></span></a>'; '<i></i> <span></span></a>';
if (link.asDropdown) { if (link.asDropdown) {
template += '<ul class="dropdown-menu" role="menu">' + template += '<ul class="dropdown-menu" role="menu">' +
'<li ng-repeat="dash in link.searchHits"><a href="{{dash.url}}"><i class="fa fa-th-large"></i> {{dash.title}}</a></li>' + '<li ng-repeat="dash in link.searchHits"><a href="{{dash.url}}">{{dash.title}}</a></li>' +
'</ul>'; '</ul>';
} }
template += '</div>';
elem.html(template); elem.html(template);
$compile(elem.contents())(scope); $compile(elem.contents())(scope);
......
...@@ -7,6 +7,7 @@ $gf-form-margin: 0.25rem; ...@@ -7,6 +7,7 @@ $gf-form-margin: 0.25rem;
align-items: center; align-items: center;
text-align: left; text-align: left;
position: relative; position: relative;
font-size: $font-size-sm;
&--offset-1 { &--offset-1 {
margin-left: $spacer; margin-left: $spacer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment