Last active
March 28, 2016 15:04
-
-
Save tkrkt/6d2c4d67c340c1c5082b to your computer and use it in GitHub Desktop.
Trelloで何もカード選択してない時でもカーソルキー効くようにするグリモン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name TrelloCardSelector | |
// @namespace jp.tkrkt | |
// @description フォーカスしてない時でもキーボードでカードを選択 | |
// @include https://trello.com/b/*/* | |
// @version 1.1 | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener('keydown', (event) => { | |
if (36 < event.keyCode && event.keyCode < 41) { // is cursor key | |
if (!document.querySelector('.list-card.active-card')) { // is not active | |
var firstItem = document.querySelector('.list-card'); | |
firstItem.dispatchEvent(new MouseEvent('mousemove')); | |
return false; | |
} | |
} | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment