Commit 46ab09ed by Torkel Ödegaard

feat(links): fixed styling for dashboard links

parent dc3b6147
......@@ -13,11 +13,14 @@
<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>
</div>
</ul>
</div>
<div class="gf-form gf-form--grow">
</div>
<ul class="pull-right" ng-if="ctrl.dashboard.links.length > 0">
<dash-links-container links="ctrl.dashboard.links"></dash-links-container>
</ul>
<div ng-if="ctrl.dashboard.links.length > 0" >
<dash-links-container links="ctrl.dashboard.links" class="gf-form-inline"></dash-links-container>
</div>
<div class="clearfix"></div>
</div>
......@@ -44,17 +44,19 @@ function (angular, _) {
restrict: 'E',
link: function(scope, elem) {
var link = scope.link;
var template = '<div class="submenu-item dropdown">' +
'<a class="pointer dash-nav-link" data-placement="bottom"' +
var template = '<div class="gf-form">' +
'<a class="pointer gf-form-label" data-placement="bottom"' +
(link.asDropdown ? ' ng-click="fillDropdown(link)" data-toggle="dropdown"' : "") + '>' +
'<i></i> <span></span></a>';
if (link.asDropdown) {
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>';
}
template += '</div>';
elem.html(template);
$compile(elem.contents())(scope);
......
......@@ -7,6 +7,7 @@ $gf-form-margin: 0.25rem;
align-items: center;
text-align: left;
position: relative;
font-size: $font-size-sm;
&--offset-1 {
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