Allow to customize observing attributes
This commit is contained in:
parent
289181d28b
commit
32cd96d1f2
@ -299,9 +299,13 @@ GroupTab.prototype = inherit(TreeStyleTabBase, {
|
||||
tab.parentNode.addEventListener(this.kEVENT_TYPE_ATTACHED, this, false);
|
||||
tab.parentNode.addEventListener(this.kEVENT_TYPE_DETACHED, this, false);
|
||||
|
||||
this.tabsObserver = new TabAttributesObserver(this.browser.tabContainer, (function(aTab) {
|
||||
this.onTabModified(aTab);
|
||||
}).bind(this));
|
||||
this.tabsObserver = new TabAttributesObserver({
|
||||
container : this.browser.tabContainer,
|
||||
attributes : 'label,visibleLabel,image',
|
||||
callback : (function(aTab) {
|
||||
this.onTabModified(aTab);
|
||||
}).bind(this)
|
||||
});
|
||||
|
||||
this.editor.addEventListener('keypress', this, false);
|
||||
|
||||
|
@ -37,9 +37,12 @@ var EXPORTED_SYMBOLS = ['TabAttributesObserver'];
|
||||
|
||||
Components.utils.import('resource://treestyletab-modules/constants.js');
|
||||
|
||||
function TabAttributesObserver(aContainer, aCallback) {
|
||||
this.container = aContainer;
|
||||
this.callback = aCallback;
|
||||
function TabAttributesObserver(aParams) {
|
||||
this.container = aParams.container;
|
||||
this.attributes = aParams.attributes;
|
||||
if (typeof this.attributes == 'string')
|
||||
this.attributes = this.attributes.split(',');
|
||||
this.callback = aParams.callback;
|
||||
this.init();
|
||||
}
|
||||
TabAttributesObserver.prototype = {
|
||||
|
Loading…
Reference in New Issue
Block a user