Merge pull request #361 from saneyuki/PseudoTreeBuilder

Define PseudoTreeBuilder without inheriting TreeStyleTabUtils
This commit is contained in:
YUKI "Piro" Hiroshi 2012-09-17 08:47:06 -07:00
commit 3491a4cfd7

View File

@ -38,10 +38,11 @@ const EXPORTED_SYMBOLS = ['PseudoTreeBuilder'];
const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import('resource://treestyletab-modules/utils.js');
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabUtils', 'resource://treestyletab-modules/utils.js');
var PseudoTreeBuilder = {
__proto__ : TreeStyleTabUtils,
kFAVICON : 'treestyletab-pseudo-tree-favicon',
kROOTITEM : 'treestyletab-pseudo-tree-root-item',
@ -104,7 +105,7 @@ var PseudoTreeBuilder = {
if (w.isBlankPageURL ? !w.isBlankPageURL(uri) : (uri != 'about:blank')) tooltip += '\n' + uri;
label.setAttribute('tooltiptext', tooltip);
label.setAttribute('class', 'text-link '+this.kTREEITEM);
label.setAttribute('tab-id', this.getTabValue(aTab, this.kID));
label.setAttribute('tab-id', TreeStyleTabUtils.getTabValue(aTab, TreeStyleTabUtils.kID));
var children = this.createTabChildren(aTab);
if (children) {
@ -122,7 +123,7 @@ var PseudoTreeBuilder = {
{
var doc = aTab.ownerDocument;
var children = this.getChildTabs(aTab);
var children = TreeStyleTabUtils.getChildTabs(aTab);
if (!children.length)
return null;