forked from JackAdams/constellation-tiny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtiny-client.js
44 lines (37 loc) · 1.07 KB
/
tiny-client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Hook in to constellation UI
var Constellation = Package["planable:console"].API;
Constellation.addTab({
name: "Tiny",
headerContentTemplate: "Constellation_tiny",
noOpen: true,
onClick: "toggleTinyInterface",
});
Constellation.registerCallbacks({
toggleTinyInterface: function () {
TinyDict.set("Constellation_tiny", !TinyDict.get("Constellation_tiny"));
toggleTiny(TinyDict.get("Constellation_tiny"));
},
});
TinyDict = new ReactiveDict("constellation-tiny");
var toggleTiny = function (isTiny) {
var constellationClasses = Package[
"planable:console"
].Constellation.ConstellationDict.get("Constellation_baseClasses");
if (isTiny) {
constellationClasses += "Constellation-tiny ";
} else {
constellationClasses = constellationClasses.replace(
/Constellation-tiny /,
""
);
}
Package["planable:console"].Constellation.ConstellationDict.set(
"Constellation_baseClasses",
constellationClasses
);
};
Template.Constellation_tiny.helpers({
tiny: function () {
return TinyDict.get('Constellation_tiny');
}
});