From 26f75b85fae6acdb6cf47abab7c622908e5588b5 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sat, 21 Feb 2015 21:53:25 -0500 Subject: [PATCH] Rework window filtering to actually use filter --- background.js | 14 ++++++++------ popup.js | 5 +---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/background.js b/background.js index dfcc120..bb78c3f 100644 --- a/background.js +++ b/background.js @@ -6,13 +6,15 @@ function createWindowStorage(callback){ function populateWindowStorage(callback){ chrome.windows.getAll({'populate':true},function(result){ + result = result.filter(function(currentWindow){ + return currentWindow.type=="normal"; + }) result.forEach(function(currentWindow,i){ - if (currentWindow.type=="normal") - addWindow(currentWindow,i,function(j){ - if (j==result.length-1){ - saveWindows(); - } - }); + addWindow(currentWindow,i,function(j){ + if (j==result.length-1){ + saveWindows(); + } + }); }); }); } diff --git a/popup.js b/popup.js index a659267..7a93502 100644 --- a/popup.js +++ b/popup.js @@ -146,7 +146,6 @@ function setupTabs(tabs,callback){ pinButton.onclick = function(event){ event.preventDefault(); event.stopPropagation(); - console.log("click!"); if (pinButton.classList.contains('pinned')){ pinButton.classList.remove("pinned"); chrome.tabs.update(currentTab.id, {'pinned':false}); @@ -234,9 +233,9 @@ document.addEventListener('DOMContentLoaded', function() { var filterInput = document.getElementById("search"); var windowKeyIndex = 0; var tabKeyIndex = 0; + debugger; getWindows(mainList,setHeights); filterInput.addEventListener('input', function(event){ - console.log(filterInput.value.length===0); search(filterInput.value,function(windows){ removeChildren(mainList); getWindows(mainList,windows,function(){ @@ -283,7 +282,6 @@ document.addEventListener('DOMContentLoaded', function() { children.splice(startPos,1); children.splice(endPos, 0,temp); removeChildren(ul); - console.log(children); children.forEach(function(child){ ul.appendChild(child); }); @@ -349,7 +347,6 @@ document.addEventListener('DOMContentLoaded', function() { else{ tabList[tabKeyIndex].classList.add('keyHover'); } - console.log(tabList[tabKeyIndex].getBoundingClientRect().top); if (tabList[tabKeyIndex].getBoundingClientRect().top<=0){ scrollBy(0, tabList[tabKeyIndex].clientHeight*-1); }