From 8c1195b2777d0a37ecb294a69a7f48c52b57f55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 12 Feb 2016 15:00:47 +0100 Subject: [PATCH] refactor(): no change, only minor refactor, and update of fontsize to 14px --- public/app/core/components/grafana_app.ts | 22 ++++++++++++---------- public/less/variables.dark.less | 4 ++-- public/less/variables.light.less | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/public/app/core/components/grafana_app.ts b/public/app/core/components/grafana_app.ts index 1dd1661aff0..1c98bee266e 100644 --- a/public/app/core/components/grafana_app.ts +++ b/public/app/core/components/grafana_app.ts @@ -77,8 +77,8 @@ export class GrafanaCtrl { }); }; - f(root); $rootScope.performance.scopeCount = scopes; + f(root); return count; }; @@ -140,21 +140,23 @@ export class GrafanaCtrl { } /** @ngInject */ -export function grafanaAppDirective(playlistSrv) { +export function grafanaAppDirective(playlistSrv, contextSrv) { return { restrict: 'E', controller: GrafanaCtrl, link: (scope, elem) => { var ignoreSideMenuHide; + var body = $('body'); + // handle sidemenu open state scope.$watch('contextSrv.sidemenu', newVal => { if (newVal !== undefined) { - elem.toggleClass('sidemenu-open', scope.contextSrv.sidemenu); + body.toggleClass('sidemenu-open', scope.contextSrv.sidemenu); if (!newVal) { - scope.contextSrv.setPinnedState(false); + contextSrv.setPinnedState(false); } } - if (scope.contextSrv.sidemenu) { + if (contextSrv.sidemenu) { ignoreSideMenuHide = true; setTimeout(() => { ignoreSideMenuHide = false; @@ -164,7 +166,7 @@ export function grafanaAppDirective(playlistSrv) { scope.$watch('contextSrv.pinned', newVal => { if (newVal !== undefined) { - elem.toggleClass('sidemenu-pinned', newVal); + body.toggleClass('sidemenu-pinned', newVal); } }); @@ -174,18 +176,18 @@ export function grafanaAppDirective(playlistSrv) { }); // handle document clicks that should hide things - elem.click(function(evt) { + body.click(function(evt) { var target = $(evt.target); if (target.parents().length === 0) { return; } if (target.parents('.dash-playlist-actions').length === 0) { - playlistSrv.stop(); + playlistSrv.stop(); } // hide search - if (elem.find('.search-container').length > 0) { + if (body.find('.search-container').length > 0) { if (target.parents('.search-container').length === 0) { scope.$apply(function() { scope.appEvent('hide-dash-search'); @@ -193,7 +195,7 @@ export function grafanaAppDirective(playlistSrv) { } } // hide sidemenu - if (!ignoreSideMenuHide && !scope.contextSrv.pinned && elem.find('.sidemenu').length > 0) { + if (!ignoreSideMenuHide && !contextSrv.pinned && body.find('.sidemenu').length > 0) { if (target.parents('.sidemenu').length === 0) { scope.$apply(function() { scope.contextSrv.toggleSideMenu(); diff --git a/public/less/variables.dark.less b/public/less/variables.dark.less index 6622fe92a15..92892c4b1de 100644 --- a/public/less/variables.dark.less +++ b/public/less/variables.dark.less @@ -71,8 +71,8 @@ @serifFontFamily: Georgia, "Times New Roman", Times, serif; @monoFontFamily: Menlo, Monaco, Consolas, "Courier New", monospace; -@baseFontSize: 13px; -@baseFontWeight: 400; +@baseFontSize: 14px; +@baseFontWeight: 400; @baseFontFamily: @sansFontFamily; @baseLineHeight: 20px; @altFontFamily: @serifFontFamily; diff --git a/public/less/variables.light.less b/public/less/variables.light.less index d7380b68dfb..2322f8293f9 100644 --- a/public/less/variables.light.less +++ b/public/less/variables.light.less @@ -85,7 +85,7 @@ @monoFontFamily: Menlo, Monaco, Consolas, "Courier New", monospace; @baseFontSize: 14px; -@baseFontWeight: 400; +@baseFontWeight: 400; @baseFontFamily: @sansFontFamily; @baseLineHeight: 20px; @altFontFamily: @serifFontFamily;