1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 07:22:27 +01:00

move hrist's incomplete tab numbering patch to the Wiki for now

This commit is contained in:
Doug Kearns
2007-06-22 11:00:40 +00:00
parent 3bceee7721
commit 8de7749125

View File

@@ -1005,42 +1005,6 @@ function Tabs() //{{{
}
getBrowser().mTabContainer.selectedIndex = index;
}
/* XXX: disabled until we find a better way where to update the titles, right now
* it has O(n^2) complexity on firefox start when we load 50 tabs
* (c) by hrist
window.addEventListener("TabMove", function() { vimperator.statusline.updateTabCount(); vimperator.tabs.updateTitles(); }, false);
window.addEventListener("TabOpen", function() { vimperator.statusline.updateTabCount(); vimperator.tabs.updateTitles(); }, false);
window.addEventListener("TabClose", function() { vimperator.statusline.updateTabCount(); vimperator.tabs.updateTitles(); }, false);
this.updateTitles = function(forceclear)
{
for(var i=0;i < vimperator.tabs.count();i++)
{
var old_title = getBrowser().mTabContainer.childNodes[i].getAttribute("label");
var split_title = old_title.match(/^(\d+:\s+)(.*)/);
if(forceclear)
{
for(var i=0;i<vimperator.tabs.count();i++)
getBrowser().mTabContainer.childNodes[i].setAttribute("label", split_title[2]);
return;
}
var numbertabs = vimperator.options["numbertabs"];
if(numbertabs)
{
if(split_title)
{
var new_title = (i+1) + ": "+ split_title[2];
}
else var new_title = (i+1) + ": " + old_title;
getBrowser().mTabContainer.childNodes[i].setAttribute("label", new_title);
}
else getBrowser().mTabContainer.childNodes[i].setAttribute("label", split_title[2]);
}
}
*/
//}}}
} //}}}