Skip to content

Commit 41f183d

Browse files
committed
Use prefer layout over layoutService
1 parent 1cfefeb commit 41f183d

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

app/controllers/application.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class ApplicationController extends Controller {
1313
* Service used to broadcast changes to the application's layout
1414
* such as toggling of the object inspector.
1515
*/
16-
@service('layout') layoutService;
16+
@service layout;
1717
@service port;
1818

1919
// Indicates that the extension window is focused,
@@ -84,22 +84,20 @@ export default class ApplicationController extends Controller {
8484
@action
8585
setupContentElement(element) {
8686
this.contentElement = element;
87-
this.layoutService.updateContentHeight(this.contentElement.clientHeight);
87+
this.layout.updateContentHeight(this.contentElement.clientHeight);
8888
}
8989

9090
@action
9191
_windowDidResize() {
9292
// eslint-disable-next-line ember/no-runloop
9393
schedule('afterRender', () => {
9494
if (!this.isDestroyed && !this.isDestroying) {
95-
this.layoutService.trigger('resize', {
95+
this.layout.trigger('resize', {
9696
source: 'application-controller',
9797
});
9898

9999
if (this.contentElement) {
100-
this.layoutService.updateContentHeight(
101-
this.contentElement.clientHeight,
102-
);
100+
this.layout.updateContentHeight(this.contentElement.clientHeight);
103101
}
104102
}
105103
});
@@ -116,7 +114,7 @@ export default class ApplicationController extends Controller {
116114
this.navIsCollapsed = !this.navIsCollapsed;
117115
// eslint-disable-next-line ember/no-runloop
118116
schedule('afterRender', () => {
119-
this.layoutService.trigger('resize', { source: 'navigation' });
117+
this.layout.trigger('resize', { source: 'navigation' });
120118
});
121119
}
122120

app/routes/application.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class ApplicationRoute extends Route {
99
@service adapter;
1010
@service port;
1111
@service router;
12-
@service('layout') layoutService;
12+
@service layout;
1313

1414
setupController(controller) {
1515
controller.set('mixinStack', []);
@@ -65,7 +65,7 @@ export default class ApplicationRoute extends Route {
6565
controller.activateMixinDetails(name, objectId, details, errors);
6666
}
6767

68-
this.layoutService.showInspector();
68+
this.layout.showInspector();
6969
}
7070

7171
setDeprecationCount(message) {

app/templates/application.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
<div class="split-panel">
4848
<div class="split-panel-hd split-panel-hd-row">
4949
<div id="toolbar"></div>
50-
{{#if (not this.layoutService.inspectorExpanded)}}
50+
{{#unless this.layout.inspectorExpanded}}
5151
<ObjectInspector::Toggle class="end" />
52-
{{/if}}
52+
{{/unless}}
5353
</div>
5454

5555
<div class="split-panel-bd" {{did-insert this.setupContentElement}}>
@@ -59,7 +59,7 @@
5959
</div>
6060
</div>
6161

62-
{{#if this.layoutService.inspectorExpanded}}
62+
{{#if this.layout.inspectorExpanded}}
6363
<Ui::DraggableColumn
6464
@classes="split-panel"
6565
@side="right"

0 commit comments

Comments
 (0)