-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.js
51 lines (44 loc) · 1.51 KB
/
dashboard.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
45
46
47
48
49
50
51
/// <reference path="jquery.d.ts"/>
/// <reference path="Tile.ts"/>
/// <reference path="Blade.ts"/>
var Dashboard = (function () {
function Dashboard(dom) {
this.tiles = new Array();
this.blades = new Array();
this.baseDOM = dom;
this.load();
}
Dashboard.prototype.load = function () {
$(this.baseDOM).find("header").html("Start");
// Set Height
$("body").css("height", $(window).height() + "px");
var tileContainer = $(this.baseDOM).find("section.tiles");
$(tileContainer).delegate("div.tile", "click", tileClicked);
var t = new Tile(1 /* Medium */, "RFID");
t.icon = "nfccard.svg";
t.uri = "/rfid";
var e = t.gen(this.tiles.push(t));
tileContainer.append(e);
var t = new Tile(1 /* Medium */, "PIR Sensor");
t.icon = "motion.svg";
t.uri = "/pir";
var e = t.gen(this.tiles.push(t));
tileContainer.append(e);
var t = new Tile(1 /* Medium */, "");
t.icon = "settings.svg";
t.uri = "/options";
var e = t.gen(this.tiles.push(t));
tileContainer.append(e);
var t = new Tile(4 /* Hero */, "Hue");
t.icon = "lightbulb.svg";
t.uri = "/hue";
var e = t.gen(this.tiles.push(t));
tileContainer.append(e);
};
return Dashboard;
})();
function recalcBodyWidth(blade) {
var extraWidth = $(blade).width();
var bodyWidth = $('body').width();
$('body').css("width", bodyWidth + extraWidth);
}