From 99bb9a5e9eb77965cf5a89c2ebd9eb6bff47857e Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Thu, 5 Mar 2015 13:31:34 -0500 Subject: [PATCH] Add window clicking to switch windows, works towards resolving #16 --- popup.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/popup.js b/popup.js index 023569f..7e7ad49 100644 --- a/popup.js +++ b/popup.js @@ -70,6 +70,7 @@ function setupWindowElement(currentWindow,callback){ var tabInfo = document.createElement("span"); var tabCount = document.createElement("span"); var tabWord = document.createElement("span"); + var clickCount = 0; li.classList.add("window"); li.classList.add("noselect"); ul.classList.add("tabs"); @@ -86,6 +87,33 @@ function setupWindowElement(currentWindow,callback){ tabCount.textContent = currentWindow.tabs.length.toString(); tabWord.classList.add("tabWord"); tabWord.textContent = (currentWindow.tabs.length>1 ? " tabs":" tab"); + textContent.addEventListener('click',function(event){ + if (event.clientX>windowName.getBoundingClientRect().left && event.clientXwindowName.getBoundingClientRect().left && event.clientX