From eb0f5cc900e7928ed4a69d244278671aaba16294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 31 Aug 2017 16:38:49 +0200 Subject: [PATCH] ux: progress on metrics tab changes --- public/app/core/core.ts | 1 + public/app/core/utils/outline.js | 32 +++++ public/app/features/panel/metrics_tab.ts | 18 ++- .../features/panel/partials/metrics_tab.html | 113 ++++++++---------- .../app/plugins/datasource/graphite/help.md | 7 +- public/sass/_variables.dark.scss | 2 +- public/sass/components/_gf-form.scss | 4 + public/sass/components/_infobox.scss | 13 +- public/sass/mixins/_animations.scss | 11 ++ 9 files changed, 112 insertions(+), 89 deletions(-) create mode 100644 public/app/core/utils/outline.js diff --git a/public/app/core/core.ts b/public/app/core/core.ts index f7ebb614d2a..6a5702d1f12 100644 --- a/public/app/core/core.ts +++ b/public/app/core/core.ts @@ -20,6 +20,7 @@ import './jquery_extended'; import './partials'; import './components/jsontree/jsontree'; import './components/code_editor/code_editor'; +import './utils/outline'; import {grafanaAppDirective} from './components/grafana_app'; import {sideMenuDirective} from './components/sidemenu/sidemenu'; diff --git a/public/app/core/utils/outline.js b/public/app/core/utils/outline.js new file mode 100644 index 00000000000..f968b3e51f9 --- /dev/null +++ b/public/app/core/utils/outline.js @@ -0,0 +1,32 @@ +// outline.js +// based on http://www.paciellogroup.com/blog/2012/04/how-to-remove-css-outlines-in-an-accessible-manner/ +(function(d) { + "use strict"; + + var style_element = d.createElement('STYLE'), + dom_events = 'addEventListener' in d, + add_event_listener = function(type, callback) { + // Basic cross-browser event handling + if(dom_events){ + d.addEventListener(type, callback); + } else { + d.attachEvent('on' + type, callback); + } + }, + set_css = function(css_text) { + // Handle setting of