1.7.1 - Firefox quick fix for bug 149, 150, 151

This commit is contained in:
karol@jagiello.it 2018-07-04 17:29:50 +02:00
parent 48dccfecd6
commit ef57faa773
6 changed files with 44 additions and 27 deletions

View File

@ -48,5 +48,5 @@
"page": "options.html",
"open_in_tab": true
},
"version": "1.7.0"
"version": "1.7.1"
}

View File

@ -259,6 +259,12 @@ function QuantumLoadTabs(retry) {
} else {
QuantumAppendWinTTId(winId);
}
if (b.windows[winId].activeTabId == undefined) { // legacy
b.windows[winId].activeTabId = [0,0]; // legacy
} // legacy
for (let tIndex = 0; tIndex < tabsCount; tIndex++) {
let tab = w[winIndex].tabs[tIndex];
let tabIndex = tIndex;

View File

@ -488,6 +488,7 @@ function OnMessageTabCreated(tabId) {
} else {
if (opt.append_orphan_tab == "as_child" && opt.orphaned_tabs_to_ungrouped == false) {
// let atb = NewTab.active ? 0 : 1;
NewTab.openerTabId = b.windows[NewTab.windowId].activeTabId[NewTab.active ? 0 : 1];
}
@ -623,34 +624,43 @@ function OnMessageTabCreated(tabId) {
if (opt.append_orphan_tab == "after_active") {
let activeTabId = b.windows[NewTab.windowId].activeTabId[1] != NewTab.id ? b.windows[NewTab.windowId].activeTabId[1] : b.windows[NewTab.windowId].activeTabId[0];
if (b.windows[NewTab.windowId] && b.windows[NewTab.windowId].activeTabId) {
let activeTabId = b.windows[NewTab.windowId].activeTabId[1] != NewTab.id ? b.windows[NewTab.windowId].activeTabId[1] : b.windows[NewTab.windowId].activeTabId[0];
// console.log(b.tabs[activeTabId].index);
if (b.tabs[activeTabId]) {
let ActiveSiblings = GetChildren(b.tabs[activeTabId].parent);
b.tabs[NewTab.id].parent = b.tabs[activeTabId].parent;
b.tabs[NewTab.id].index = b.tabs[activeTabId].index+1;
for (let i = ActiveSiblings.indexOf(activeTabId)+1; i < ActiveSiblings.length; i++) { // shift next siblings indexes
// let prev = b.tabs[ActiveSiblings[i]].index;
b.tabs[ActiveSiblings[i]].index += 1;
// console.log(prev + " " + b.tabs[ActiveSiblings[i]].index );
// console.log(b.tabs[activeTabId].index);
if (b.tabs[activeTabId]) {
let ActiveSiblings = GetChildren(b.tabs[activeTabId].parent);
b.tabs[NewTab.id].parent = b.tabs[activeTabId].parent;
b.tabs[NewTab.id].index = b.tabs[activeTabId].index+1;
for (let i = ActiveSiblings.indexOf(activeTabId)+1; i < ActiveSiblings.length; i++) { // shift next siblings indexes
// let prev = b.tabs[ActiveSiblings[i]].index;
b.tabs[ActiveSiblings[i]].index += 1;
// console.log(prev + " " + b.tabs[ActiveSiblings[i]].index );
}
if (browserId == "F"){
b.tabs[NewTab.id].parent_ttid = b.tabs[activeTabId].parent_ttid;
}
AfterId = activeTabId;
} else { // FAIL, no active tab!
let GroupTabs = GetChildren(b.windows[NewTab.windowId].active_group);
b.tabs[NewTab.id].parent = b.windows[NewTab.windowId].active_group;
if (browserId == "F"){
b.tabs[NewTab.id].parent_ttid = "";
}
if (GroupTabs.length > 0) {
b.tabs[NewTab.id].index = b.tabs[GroupTabs[GroupTabs.length-1]].index+1;
} else {
b.tabs[NewTab.id].index = 0;
}
ParentId = b.windows[NewTab.windowId].active_group;
}
if (browserId == "F"){
b.tabs[NewTab.id].parent_ttid = b.tabs[activeTabId].parent_ttid;
}
AfterId = activeTabId;
} else { // FAIL, no active tab!
let GroupTabs = GetChildren(b.windows[NewTab.windowId].active_group);
b.tabs[NewTab.id].parent = b.windows[NewTab.windowId].active_group;
} else {
b.tabs[NewTab.id].parent = "tab_list";
if (browserId == "F"){
b.tabs[NewTab.id].parent_ttid = "";
}
if (GroupTabs.length > 0) {
b.tabs[NewTab.id].index = b.tabs[GroupTabs[GroupTabs.length-1]].index+1;
} else {
b.tabs[NewTab.id].index = 0;
}
ParentId = b.windows[NewTab.windowId].active_group;
b.tabs[NewTab.id].index = NewTab.index;
ParentId = "tab_list";
}
// console.log(b.tabs[NewTab.id].index);
}

View File

@ -48,5 +48,5 @@
"page": "options.html",
"open_in_tab": true
},
"version": "1.7.0"
"version": "1.7.1"
}

View File

@ -29,6 +29,7 @@ function SetEvents() {
document.oncontextmenu = function(event){
if (!event.ctrlKey && event.target.classList.contains("text_input") == false) {
event.preventDefault();
return false;
}
}
document.body.onresize = function(event) {

View File

@ -32,7 +32,7 @@
<link type="text/css" rel="stylesheet" media="all" href="theme/theme.css" id="theme" />
<link type="text/css" rel="stylesheet" media="all" href="theme/theme_manager.css" id="manager" />
</head>
<body id="body" class="sidebar_body" oncontextmenu="return false;">
<body id="body" class="sidebar_body">
<div id="DragImage" style="display: none; width:0px; height:0px;"></div>