mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(): added page-dashboard body class
This commit is contained in:
parent
8c1195b277
commit
b369b7e495
@ -171,7 +171,16 @@ export function grafanaAppDirective(playlistSrv, contextSrv) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// tooltip removal fix
|
// tooltip removal fix
|
||||||
scope.$on("$routeChangeSuccess", function() {
|
// manage page classes
|
||||||
|
var pageClass;
|
||||||
|
scope.$on("$routeChangeSuccess", function(evt, data) {
|
||||||
|
if (pageClass) {
|
||||||
|
body.removeClass(pageClass);
|
||||||
|
}
|
||||||
|
pageClass = data.$$route.pageClass;
|
||||||
|
if (pageClass) {
|
||||||
|
body.addClass(pageClass);
|
||||||
|
}
|
||||||
$("#tooltip, .tooltip").remove();
|
$("#tooltip, .tooltip").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
///<reference path="./mod_defs.d.ts" />
|
///<reference path="./mod_defs.d.ts" />
|
||||||
|
|
||||||
import "./directives/annotation_tooltip";
|
import "./directives/annotation_tooltip";
|
||||||
import "./directives/body_class";
|
import "./directives/dash_class";
|
||||||
import "./directives/confirm_click";
|
import "./directives/confirm_click";
|
||||||
import "./directives/dash_edit_link";
|
import "./directives/dash_edit_link";
|
||||||
import "./directives/dash_upload";
|
import "./directives/dash_upload";
|
||||||
|
@ -6,7 +6,7 @@ define([
|
|||||||
function (_, $, coreModule) {
|
function (_, $, coreModule) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
coreModule.default.directive('bodyClass', function() {
|
coreModule.default.directive('dashClass', function() {
|
||||||
return {
|
return {
|
||||||
link: function($scope, elem) {
|
link: function($scope, elem) {
|
||||||
|
|
@ -18,25 +18,30 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
|
|||||||
templateUrl: 'public/app/partials/dashboard.html',
|
templateUrl: 'public/app/partials/dashboard.html',
|
||||||
controller : 'LoadDashboardCtrl',
|
controller : 'LoadDashboardCtrl',
|
||||||
reloadOnSearch: false,
|
reloadOnSearch: false,
|
||||||
|
pageClass: 'page-dashboard',
|
||||||
})
|
})
|
||||||
.when('/dashboard/:type/:slug', {
|
.when('/dashboard/:type/:slug', {
|
||||||
templateUrl: 'public/app/partials/dashboard.html',
|
templateUrl: 'public/app/partials/dashboard.html',
|
||||||
controller : 'LoadDashboardCtrl',
|
controller : 'LoadDashboardCtrl',
|
||||||
reloadOnSearch: false,
|
reloadOnSearch: false,
|
||||||
|
pageClass: 'page-dashboard',
|
||||||
})
|
})
|
||||||
.when('/dashboard-solo/:type/:slug', {
|
.when('/dashboard-solo/:type/:slug', {
|
||||||
templateUrl: 'public/app/features/panel/partials/soloPanel.html',
|
templateUrl: 'public/app/features/panel/partials/soloPanel.html',
|
||||||
controller : 'SoloPanelCtrl',
|
controller : 'SoloPanelCtrl',
|
||||||
|
pageClass: 'page-dashboard',
|
||||||
})
|
})
|
||||||
.when('/dashboard-import/:file', {
|
.when('/dashboard-import/:file', {
|
||||||
templateUrl: 'public/app/partials/dashboard.html',
|
templateUrl: 'public/app/partials/dashboard.html',
|
||||||
controller : 'DashFromImportCtrl',
|
controller : 'DashFromImportCtrl',
|
||||||
reloadOnSearch: false,
|
reloadOnSearch: false,
|
||||||
|
pageClass: 'page-dashboard',
|
||||||
})
|
})
|
||||||
.when('/dashboard/new', {
|
.when('/dashboard/new', {
|
||||||
templateUrl: 'public/app/partials/dashboard.html',
|
templateUrl: 'public/app/partials/dashboard.html',
|
||||||
controller : 'NewDashboardCtrl',
|
controller : 'NewDashboardCtrl',
|
||||||
reloadOnSearch: false,
|
reloadOnSearch: false,
|
||||||
|
pageClass: 'page-dashboard',
|
||||||
})
|
})
|
||||||
.when('/import/dashboard', {
|
.when('/import/dashboard', {
|
||||||
templateUrl: 'public/app/features/dashboard/partials/import.html',
|
templateUrl: 'public/app/features/dashboard/partials/import.html',
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<div body-class class="dashboard" ng-if="dashboard">
|
<div dash-class ng-if="dashboard">
|
||||||
<dashnav></dashnav>
|
<dashnav></dashnav>
|
||||||
|
|
||||||
<div class="main-view-container">
|
<div class="dashboard-container">
|
||||||
|
|
||||||
<div dash-editor-view></div>
|
<div dash-editor-view></div>
|
||||||
<dashboard-search></dashboard-search>
|
<dashboard-search></dashboard-search>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<dashboard-submenu ng-if="submenuEnabled" dashboard="dashboard"></dashboard-submenu>
|
<dashboard-submenu ng-if="submenuEnabled" dashboard="dashboard"></dashboard-submenu>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<div class="grafana-row" ng-controller="RowCtrl" ng-repeat="(row_name, row) in dashboard.rows" row-height>
|
<div class="grafana-row" ng-controller="RowCtrl" ng-repeat="(row_name, row) in dashboard.rows" row-height>
|
||||||
<div class="row-control">
|
<div class="row-control">
|
||||||
@ -60,8 +60,8 @@
|
|||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a ng-click="moveRow('up')">Up</a></li>
|
<li><a ng-click="moveRow('up')">Up</a></li>
|
||||||
<li><a ng-click="moveRow('down')">Down</a></li>
|
<li><a ng-click="moveRow('down')">Down</a></li>
|
||||||
<li><a ng-click="moveRow('top')">To top</a></li>
|
<li><a ng-click="moveRow('top')">To top</a></li>
|
||||||
<li><a ng-click="moveRow('bottom')">To Bottom</a></li>
|
<li><a ng-click="moveRow('bottom')">To Bottom</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -105,5 +105,5 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -84,8 +84,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.page-header-align {
|
.page-header-align {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
|
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
|
||||||
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
|
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
|
||||||
|
@ -88,6 +88,23 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dashboard-container {
|
||||||
|
padding: 5px 5px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-view {
|
||||||
|
background-image: url(/img/grafana_pattern.png);
|
||||||
|
background-position: 100% -550px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-dashboard {
|
||||||
|
.main-view {
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Srollbars
|
// Srollbars
|
||||||
|
@ -14,19 +14,8 @@
|
|||||||
padding-right: 0px;
|
padding-right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-view-container {
|
|
||||||
padding: 5px 10px;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backgrounds
|
// Backgrounds
|
||||||
// ---------------------
|
// ---------------------
|
||||||
.main-view {
|
|
||||||
// background: url(/img/grafana_pattern.png);
|
|
||||||
background-position: 100% -550px;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgNav {
|
.bgNav {
|
||||||
background: @navbarBackground;
|
background: @navbarBackground;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
.sidemenu-wrapper {
|
.sidemenu-wrapper {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
.main-view-container {
|
.dashboard-container {
|
||||||
padding-left: @sideMenuWidth;
|
padding-left: @sideMenuWidth;
|
||||||
}
|
}
|
||||||
.page-container {
|
.page-container {
|
||||||
|
Loading…
Reference in New Issue
Block a user