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", "page": "options.html",
"open_in_tab": true "open_in_tab": true
}, },
"version": "1.7.0" "version": "1.7.1"
} }

View File

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

View File

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

View File

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

View File

@ -29,6 +29,7 @@ function SetEvents() {
document.oncontextmenu = function(event){ document.oncontextmenu = function(event){
if (!event.ctrlKey && event.target.classList.contains("text_input") == false) { if (!event.ctrlKey && event.target.classList.contains("text_input") == false) {
event.preventDefault(); event.preventDefault();
return false;
} }
} }
document.body.onresize = function(event) { 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.css" id="theme" />
<link type="text/css" rel="stylesheet" media="all" href="theme/theme_manager.css" id="manager" /> <link type="text/css" rel="stylesheet" media="all" href="theme/theme_manager.css" id="manager" />
</head> </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> <div id="DragImage" style="display: none; width:0px; height:0px;"></div>