[Tree] Begin wiring in selection

This commit is contained in:
Victor Woeltjen
2016-03-11 17:09:17 -08:00
parent 03ab3bddc4
commit 82b6166408
3 changed files with 18 additions and 4 deletions

View File

@@ -103,6 +103,16 @@ define([
});
};
TreeView.prototype.observe = function (callback) {
callback(this.selectedObject);
this.callbacks.push(callback);
return function () {
this.callbacks = this.callbacks.filter(function (c) {
return c !== callback;
});
}.bind(this);
};
/**
*
* @returns {HTMLElement[]}