Skip to content

Instantly share code, notes, and snippets.

@simon-weber
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simon-weber/e3f0b6ed986c4257f713 to your computer and use it in GitHub Desktop.
Save simon-weber/e3f0b6ed986c4257f713 to your computer and use it in GitHub Desktop.
indicate gmail focus
function is_non_inbox_node(node){
var is_non_inbox = false;
if (node.isContentEditable ||
node.tagName == 'INPUT' ||
node.tagName == 'TEXTAREA' ||
node.getAttribute('aria-haspopup') == 'true'
){
is_non_inbox = true;
}
/* console.log(is_non_inbox, node); */
return is_non_inbox;
}
document.addEventListener('focusin', function(e) {
if (is_non_inbox_node(e.target)){
cursor = document.querySelector('.PF.PE');
cursor.classList.remove('PE');
cursor.classList.add('PE-hide');
}
});
document.addEventListener('focusout', function(e) {
if (is_non_inbox_node(e.target)){
cursor = document.querySelector('.PF.PE-hide');
cursor.classList.add('PE');
cursor.classList.remove('PE-hide');
}
});
.f7.nH {
/* Add a inbox-style cursor to chat boxes. */
border-left-width: 5px !important;
}
.PF {
/* Make inbox cursor larger. */
width: 3px !important;
}
@simon-weber
Copy link
Author

I use this with Minmalist for Everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment