Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
aa3fc9f4
Commit
aa3fc9f4
authored
Oct 25, 2017
by
Patrick O'Carroll
Committed by
Torkel Ödegaard
Oct 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted outline.js to outline.ts (#9658)
parent
4b5929d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
public/app/core/utils/outline.ts
+22
-20
No files found.
public/app/core/utils/outline.
j
s
→
public/app/core/utils/outline.
t
s
View file @
aa3fc9f4
// outline.js
// based on http://www.paciellogroup.com/blog/2012/04/how-to-remove-css-outlines-in-an-accessible-manner/
(
function
(
d
)
{
"use strict"
;
function
outlineFixer
(
)
{
let
d
:
any
=
document
;
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 <style> element contents in IE8
!!
style_element
.
styleSheet
?
style_element
.
styleSheet
.
cssText
=
css_text
:
style_element
.
innerHTML
=
css_text
;
};
var
style_element
=
d
.
createElement
(
'STYLE'
);
var
dom_events
=
'addEventListener'
in
d
;
var
add_event_listener
=
function
(
type
,
callback
)
{
// Basic cross-browser event handling
if
(
dom_events
)
{
d
.
addEventListener
(
type
,
callback
);
}
else
{
d
.
attachEvent
(
'on'
+
type
,
callback
);
}
};
var
set_css
=
function
(
css_text
)
{
// Handle setting of <style> element contents in IE8
!!
style_element
.
styleSheet
?
style_element
.
styleSheet
.
cssText
=
css_text
:
style_element
.
innerHTML
=
css_text
;
};
d
.
getElementsByTagName
(
'HEAD'
)[
0
].
appendChild
(
style_element
);
// Using mousedown instead of mouseover, so that previously focused elements don't lose focus ring on mouse move
add_event_listener
(
'mousedown'
,
function
()
{
add_event_listener
(
'mousedown'
,
function
()
{
set_css
(
':focus{outline:0 !important}::-moz-focus-inner{border:0;}'
);
});
add_event_listener
(
'keydown'
,
function
()
{
add_event_listener
(
'keydown'
,
function
()
{
set_css
(
''
);
});
}
})(
document
);
outlineFixer
(
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment