Created
June 30, 2019 08:27
-
-
Save anushshukla/f2f838c2ef0282d32fbc7d69e51c3cf9 to your computer and use it in GitHub Desktop.
Get Revised Open Application List on pressing of Alt + Tab (no of tab hits, matters)
This file contains hidden or 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
| function moveElement(array, fromIndex, toIndex) { | |
| var element = array[fromIndex]; | |
| array.splice(fromIndex, 1); | |
| array.splice(toIndex, 0, element); | |
| } | |
| function getTabList(openApplicationsCount, tabKeyPressedCount, openApplicationsList) { | |
| var activeTabApplicationIndex = tabKeyPressedCount - 1; | |
| // var activeApplicationTab = openApplicationsList[activeTabApplicationIndex]; | |
| // openApplicationsList.splice(activeTabApplicationIndex, 1); | |
| // openApplicationsList.unshift(activeApplicationTab); | |
| moveElement(openApplicationsList, activeTabApplicationIndex, 0); | |
| return openApplicationsList; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment