mirror of
https://gh.wpcy.net/https://github.com/presscustomizr/hueman.git
synced 2026-04-26 12:54:59 +08:00
moved jquery-plugins to assets/front/js/libs removed submodules for front js parts and fmk
37 lines
1.4 KiB
JavaScript
37 lines
1.4 KiB
JavaScript
// modified version of
|
|
// outline.js (https://github.com/lindsayevans/outline.js)
|
|
// based on http://www.paciellogroup.com/blog/2012/04/how-to-remove-css-outlines-in-an-accessible-manner/
|
|
var tcOutline;
|
|
(function(d){
|
|
tcOutline = function() {
|
|
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
|
|
if ( !!style_element.styleSheet )
|
|
style_element.styleSheet.cssText = css_text;
|
|
else
|
|
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(){
|
|
set_css('input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus,select:focus,a:focus{outline:0}input[type=file]::-moz-focus-inner,input[type=radio]::-moz-focus-inner,input[type=checkbox]::-moz-focus-inner,select::-moz-focus-inner,a::-moz-focus-inner{border:0;}');
|
|
});
|
|
|
|
add_event_listener('keydown', function(){
|
|
set_css('');
|
|
});
|
|
}
|
|
})(document);
|