diff --git a/popup.js b/popup.js index 2e1e305..5211b83 100644 --- a/popup.js +++ b/popup.js @@ -348,7 +348,7 @@ document.addEventListener('DOMContentLoaded', function() { }); window.addEventListener('keydown', function(event){ - var windowList = createWindowList(mainList, windowKeyIndex); + var windowList = createWindowList(mainList); var tabList = createTabList(mainList,windowKeyIndex); //If down is pressed, traverse through tabs. if (event.keyCode===40){ @@ -474,5 +474,17 @@ document.addEventListener('DOMContentLoaded', function() { scrollTo(0, 0); filterInput.focus(); } + //Rename a window when R is pressed + else if (event.keyCode==82){ + event.preventDefault(); + if (tabKeyIndex===-1){ + var windowList = createWindowList(mainList); + windowList[windowKeyIndex].querySelector('span.textContent > span.windowName').dispatchEvent(new MouseEvent('dblclick',{ + 'view':window, + 'bubbles':true, + 'cancellable':true + })); + } + } }); }); \ No newline at end of file