From f1d9fdca6e2465eeecfefb819b2dc12451a7c8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Wed, 27 Sep 2017 22:36:33 +0200 Subject: [PATCH] Space.selectedIndex util method --- tiling.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tiling.js b/tiling.js index 4cfa78e..1c67e53 100644 --- a/tiling.js +++ b/tiling.js @@ -54,6 +54,13 @@ Space = (workspace) => { let space = []; space.workspace = workspace; space.selectedWindow = null; + space.selectedIndex = () => { + if (space.selectedWindow) { + return space.indexOf(space.selectedWindow); + } else { + return -1; + } + } space.moving = false; space.leftStack = 0; space.rightStack = 0;