Skip to content

Commit c34ecf1

Browse files
committed
decaffeinate lib/ui
1 parent 221d71e commit c34ecf1

File tree

2 files changed

+61
-42
lines changed

2 files changed

+61
-42
lines changed

lib/ui.coffee

Lines changed: 0 additions & 42 deletions
This file was deleted.

lib/ui.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
'use babel'
2+
import { CompositeDisposable, Disposable } from 'atom';
3+
4+
export default {
5+
// TODO Fix all of these dynamic requires and circular dependencies
6+
notifications: require('./ui/notifications'),
7+
selector: require('./ui/selector'),
8+
views: require('./ui/views'),
9+
progress: require('./ui/progress'),
10+
layout: require('./ui/layout'),
11+
docpane: require('./ui/docs'),
12+
focusutils: require('./ui/focusutils'),
13+
cellhighlighter: require('./ui/cellhighlighter'),
14+
15+
activate(client) {
16+
this.client = client;
17+
this.subs = new CompositeDisposable;
18+
19+
this.notifications.activate();
20+
this.subs.add(atom.config.observe('julia-client.uiOptions.highlightCells', val => {
21+
if (val) {
22+
this.cellhighlighter.activate();
23+
} else {
24+
this.cellhighlighter.deactivate();
25+
}
26+
})
27+
);
28+
this.subs.add(new Disposable(() => {
29+
this.cellhighlighter.deactivate();
30+
})
31+
);
32+
33+
this.subs.add(this.client.onAttached(() => {
34+
this.notifications.show("Client Connected");
35+
})
36+
);
37+
this.subs.add(this.client.onDetached(() => {
38+
// TODO do we need this optional chaining check?
39+
this.ink && this.ink.Result && this.ink.Result.invalidateAll()
40+
})
41+
);
42+
},
43+
44+
deactivate() {
45+
this.subs.dispose();
46+
},
47+
48+
consumeInk(ink) {
49+
this.ink = ink;
50+
this.views.ink = this.ink;
51+
this.selector.activate(this.ink);
52+
this.docpane.activate(this.ink);
53+
this.progress.activate(this.ink);
54+
this.focusutils.activate(this.ink);
55+
this.subs.add(new Disposable(() => {
56+
this.docpane.deactivate();
57+
this.progress.deactivate();
58+
this.focusutils.deactivate();
59+
}));
60+
}
61+
};

0 commit comments

Comments
 (0)