Fixed window selection issue.
This commit is contained in:
parent
c70553b0e4
commit
9c763c0e7b
|
@ -4,10 +4,9 @@ Search Firefox tabs and get a list or automatic direct to the searched tab.
|
|||
# Download
|
||||
https://addons.mozilla.org/en-US/firefox/addon/tab-search-and-manage/
|
||||
|
||||
# Version: 1.2.8
|
||||
# Version: 1.2.9
|
||||
<ul>
|
||||
<li>Fixed search type persistence.</li>
|
||||
<li>Fixed missing starting tabs in list.</li>
|
||||
<li>Fixed window selection issue.</li>
|
||||
</ul>
|
||||
|
||||
***Note:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Tab Search and Manage",
|
||||
"version": "1.2.8",
|
||||
"version": "1.2.9",
|
||||
"description": "This plugin can search, drag-n-drop ordering, and (un)hide all or some tabs.",
|
||||
|
||||
"applications": {
|
||||
|
|
|
@ -14,10 +14,11 @@ var windowIndex = 0;
|
|||
|
||||
function logTabs(tabs) {
|
||||
windowIndex = 0;
|
||||
tabsAction.query({currentWindow: true, active: true}).then((tab) => {
|
||||
focusedWinID = tab[0].windowId;
|
||||
}, focusedWinID);
|
||||
|
||||
tabsAction.query({currentWindow: true, active: true}).then((tab) => {
|
||||
console.log(tab);
|
||||
focusedWinID = tab[0].windowId;
|
||||
}, focusedWinID).then(() => {
|
||||
for (let tab of tabs) {
|
||||
currentWinId = tab.windowId;
|
||||
if (currentWinId == newWinId) {
|
||||
|
@ -40,6 +41,7 @@ function logTabs(tabs) {
|
|||
}
|
||||
newWinId = currentWinId;
|
||||
}
|
||||
});
|
||||
|
||||
newWinId = undefined;
|
||||
// Set poped-out-window position and 100px up from selected elm
|
||||
|
@ -56,6 +58,19 @@ function createContainer(tab) {
|
|||
var hidnStImgTag = document.createElement("IMG");
|
||||
var icoImgTag = document.createElement("IMG"); // Used to properly set bg
|
||||
|
||||
// Set oldElm so eventListeners.js has starting ref
|
||||
if (tab.active == true) {
|
||||
browser.windows.getCurrent().then((window) => {
|
||||
if (tab.windowId == window.id) {
|
||||
spanTag.className = "block block-focused";
|
||||
if (oldElm) {
|
||||
oldElm.setAttribute("class", "block");
|
||||
}
|
||||
oldElm = spanTag;
|
||||
}
|
||||
}, tab, oldElm, spanTag);
|
||||
}
|
||||
|
||||
spanTag.setAttribute("tabID", tab.id);
|
||||
spanTag.title = tab.title;
|
||||
spanTag.id = "iconElm";
|
||||
|
@ -83,15 +98,6 @@ function createContainer(tab) {
|
|||
pTag.appendChild(iconText);
|
||||
spanTag.appendChild(pTag);
|
||||
listZone.appendChild(spanTag);
|
||||
|
||||
// Set oldElm so eventListeners.js has starting ref
|
||||
if (tab.active == true) {
|
||||
spanTag.className = "block block-focused";
|
||||
if (oldElm) {
|
||||
oldElm.setAttribute("class", "block");
|
||||
}
|
||||
oldElm = spanTag;
|
||||
}
|
||||
}
|
||||
|
||||
function createTab() {
|
||||
|
|
|
@ -16,7 +16,14 @@ function findTabs(tabs) {
|
|||
searchBar.value = "";
|
||||
errHandler.style.display = "none";
|
||||
clearNodes(errHandler);
|
||||
|
||||
if (selection[0].windowId == focusedWinID) {
|
||||
loadSelTab(selection[0].id);
|
||||
} else {
|
||||
browser.windows.update(selection[0].windowId, {focused: true})
|
||||
.finally(loadSelTab(selection[0].id));
|
||||
}
|
||||
|
||||
getTabs();
|
||||
} else {
|
||||
errHandler.style.display = "block";
|
||||
|
|
Loading…
Reference in New Issue