Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code #1061

Merged
merged 4 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/controllers/component-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export default Controller.extend({
*/
pinnedObjectId: null,
inspectingViews: false,
components: true,
viewTreeLoaded: false,

/**
Expand Down Expand Up @@ -159,9 +158,6 @@ export default Controller.extend({
init() {
this._super(...arguments);
this.set('expandedStateCache', {});
this.options = {
components: true
};
},

/**
Expand Down
1 change: 0 additions & 1 deletion app/routes/component-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default TabRoute.extend({
this.port.on('view:inspectDOMNode', this, this.inspectDOMNode);

this.set('controller.viewTreeLoaded', false);
this.port.send('view:setOptions', { options: this.get('controller.options') });
this.port.send('view:getTree');
},

Expand Down
33 changes: 2 additions & 31 deletions ember_debug/libs/glimmer-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default class {
* @param {Object} options
* - {owner} owner The Ember app's owner.
* - {Function} retainObject Called to retain an object for future inspection.
* - {Object} options Options whether to show components or not.
* - {Object} durations Hash containing time to render per view id.
* - {Function} highlightRange Called to highlight a range of elements.
* - {Object} ObjectInspector Used to inspect models.
Expand All @@ -52,29 +51,19 @@ export default class {
constructor({
owner,
retainObject,
options,
durations,
highlightRange,
objectInspector,
viewRegistry
}) {
this.owner = owner;
this.retainObject = retainObject;
this.options = options;
this.durations = durations;
this.highlightRange = highlightRange;
this.objectInspector = objectInspector;
this.viewRegistry = viewRegistry;
}

/**
* @method updateOptions
* @param {Object} options
*/
updateOptions(options) {
this.options = options;
}

/**
* @method updateDurations
* @param {Object} durations
Expand All @@ -84,8 +73,7 @@ export default class {
}

/**
* Builds the view tree. The view tree may or may not contain
* components depending on the current options.
* Builds the view tree.
*
* The view tree has the top level outlet as the root of the tree.
* The format is:
Expand Down Expand Up @@ -114,7 +102,7 @@ export default class {
build() {
if (this.getRoot()) {
let outletTree = this.buildOutletTree();
let componentTrees = this.options.components ? this.buildComponentTrees(outletTree) : [];
let componentTrees = this.buildComponentTrees(outletTree);
return this.addComponentsToOutlets(outletTree, componentTrees);
}
}
Expand Down Expand Up @@ -421,7 +409,6 @@ export default class {
*/
inspectComponent(component) {
let viewClass = getShortViewName(component);
let completeViewClass = viewClass;
let tagName = get(component, 'tagName');
let objectId = this.retainObject(component);
let duration = this.durations[objectId];
Expand All @@ -435,7 +422,6 @@ export default class {
objectId,
viewClass,
duration,
completeViewClass,
isComponent: true,
tagName: isNone(tagName) ? 'div' : tagName
};
Expand Down Expand Up @@ -732,19 +718,4 @@ export default class {
componentById(id) {
return this.viewRegistry[id];
}

/**
* @method modelForViewNodeValue
* @param {Boolean} isComponent
* @param {Object} inspectedNodeValue
* @return {Any} The inspected node's model (if it has one)
*/
modelForViewNodeValue({ isComponent, objectId, name }) {
if (isComponent) {
return this.modelForComponent(this.componentById(objectId));
} else {
let { controller } = A(this.outletArray()).findBy('value.name', name);
return get(controller, 'model');
}
}
}
Loading