Skip to content

Commit

Permalink
WIP: remove view tree
Browse files Browse the repository at this point in the history
  • Loading branch information
nummi committed Apr 17, 2019
1 parent 412dc4b commit d27088f
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 756 deletions.
85 changes: 0 additions & 85 deletions app/components/view-item.js

This file was deleted.

79 changes: 0 additions & 79 deletions app/controllers/view-tree.js

This file was deleted.

1 change: 0 additions & 1 deletion app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Router = EmberRouter.extend({
Router.map(function() {
this.route('app-detected', { path: '/', resetNamespace: true }, function() {
this.route('launch', { path: '/', resetNamespace: true });
this.route('view-tree', { resetNamespace: true });
this.route('component-tree', { resetNamespace: true });
this.route('route-tree', { resetNamespace: true });

Expand Down
39 changes: 37 additions & 2 deletions app/routes/component-tree.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
import ViewTree from "ember-inspector/routes/view-tree";
import TabRoute from "ember-inspector/routes/tab";

export default ViewTree.extend({
export default TabRoute.extend({
queryParams: {
pinnedObjectId: {
replace: true
}
},

model() {
return [];
},

setupController() {
this._super(...arguments);
this.get('port').on('view:viewTree', this, this.setViewTree);
this.get('port').on('view:stopInspecting', this, this.stopInspecting);
this.get('port').on('view:startInspecting', this, this.startInspecting);
this.get('port').on('view:inspectDOMElement', this, this.inspectDOMElement);

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

deactivate() {
this.get('port').off('view:viewTree', this, this.setViewTree);
this.get('port').off('view:stopInspecting', this, this.stopInspecting);
this.get('port').off('view:startInspecting', this, this.startInspecting);
this.get('port').off('view:inspectDOMElement', this, this.inspectDOMElement);
},

setViewTree(options) {
this.set('controller.viewTree', options.tree);
this.set('controller.viewTreeLoaded', true);
Expand All @@ -26,6 +49,18 @@ export default ViewTree.extend({
this.get('controller').send('inspect', viewId);
},

startInspecting() {
this.set('controller.inspectingViews', true);
},

stopInspecting() {
this.set('controller.inspectingViews', false);
},

inspectDOMElement({ elementSelector }) {
this.get('port.adapter').inspectDOMElement(elementSelector);
},

actions: {
queryParamsDidChange(params) {
const { pinnedObjectId } = params;
Expand Down
57 changes: 0 additions & 57 deletions app/routes/view-tree.js

This file was deleted.

30 changes: 0 additions & 30 deletions app/schemas/view-tree.js

This file was deleted.

6 changes: 0 additions & 6 deletions app/templates/components/side-nav.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<span class="nav__item-label">Components</span>
{{/link-to}}
</li>
<li>
{{#link-to "view-tree" class="nav__item"}}
{{svg-jar "nav-view-tree" width="20px" height="20px" class="nav__item-icon"}}
<span class="nav__item-label">View Tree</span>
{{/link-to}}
</li>
<li>
{{#link-to "route-tree" class="nav__item"}}
{{svg-jar "nav-route-tree" width="20px" height="20px" class="nav__item-icon"}}
Expand Down
65 changes: 0 additions & 65 deletions app/templates/components/view-item.hbs

This file was deleted.

Loading

0 comments on commit d27088f

Please sign in to comment.