-
Notifications
You must be signed in to change notification settings - Fork 87
/
navigator.html
130 lines (120 loc) · 4.1 KB
/
navigator.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<div class="navigator">
<div class="panel panel-default">
<div class="panel-heading btn-group projectTabs" data-toggle="buttons" style="padding: 0; width: 100%">
<label class="btnProjectTree btn btn-default active">
<input checked="checked" type="radio" name="options"/> Tree
</label>
<label class="btnTypes btn btn-default">
<input type="radio" name="options"/> Types
</label>
<label class="btnLayers btn btn-default">
<input type="radio" name="options"/> Layers
</label>
<label class="btnClassifications btn btn-default">
<input type="radio" name="options"/> Classifications
</label>
<label class="btnProperties btn btn-default">
<input type="radio" name="options"/> Properties
</label>
<label class="btnQuery btn btn-default">
<input type="radio" name="options"/> Query
</label>
</div>
<div class="panel-body sidespanWrapper">
<div class="sidespan">
<div class="projectTreeWrapper"></div>
<div class="propertiesWrapper ih"></div>
<div class="classificationWrapper ih"></div>
<div class="typesWrapper ih"></div>
<div class="layersWrapper ih"></div>
<div class="queryWrapper ih"></div>
</div>
</div>
</div>
</div>
<script>
function Navigator(containerDiv, parent) {
var o = this;
this.load = function(){
var promise = new BimServerApiPromise();
promise.chain(load(containerDiv.find(".projectTreeWrapper"), "projecttree.html", function(){
o.projecttree = new ProjectTree($(this), parent, {}, o.selectedObject);
o.sidespan = o.projecttree;
return o.projecttree.load();
}));
promise.chain(load(containerDiv.find(".typesWrapper"), "types.html", function(){
o.types = new Types($(this), parent);
}));
promise.chain(load(containerDiv.find(".layersWrapper"), "layers.html", function(){
o.layers = new Layers($(this), parent);
}));
promise.chain(load(containerDiv.find(".classificationWrapper"), "classifications.html", function(){
o.classifications = new Classifications($(this), parent);
}));
promise.chain(load(containerDiv.find(".propertiesWrapper"), "properties.html", function(){
o.properties = new Properties($(this), parent, o.selectedObject);
}));
promise.chain(load(containerDiv.find(".queryWrapper"), "query2.html", function(){
o.query = new Query2($(this), parent, o.selectedObject);
}));
return promise;
};
this.resize = function(){
var resizeBtn = $(".btnResize");
var fullscreen = resizeBtn.size() > 0 && !resizeBtn.hasClass("glyphicon-resize-full");
var width = $(window).width() / 3 - 41;
var height = ($(window).height() - $(".navbar").outerHeight() - $(".navbar-header").outerHeight() - containerDiv.find(".navigator .panel-heading").outerHeight() + 33) + (fullscreen ? 113 : 0);
containerDiv.find(".sidespanWrapper").width(width + "px");
$(".navigator").height(height + "px");
$(".sidespanWrapper").height((height - 2 - $(".panel-heading.btn-group.projectTabs").outerHeight()) + "px");
};
this.showProjectTree = function(){
if (o.sidespan != null) {
o.sidespan.hide();
}
o.sidespan = o.projecttree;
o.sidespan.show();
};
this.showProperties = function(){
if (o.sidespan != null) {
o.sidespan.hide();
}
o.sidespan = o.properties;
o.sidespan.show();
};
this.showTypes = function(){
if (o.sidespan != null) {
o.sidespan.hide();
}
o.sidespan = o.types;
o.sidespan.show();
};
this.showLayers = function(){
if (o.sidespan != null) {
o.sidespan.hide();
}
o.sidespan = o.layers;
o.sidespan.show();
};
this.showQuery = function(){
if (o.sidespan != null) {
o.sidespan.hide();
}
o.sidespan = o.query;
o.sidespan.show();
};
this.showClassifications = function(){
if (o.sidespan != null) {
o.sidespan.hide();
}
o.sidespan = o.classifications;
o.sidespan.show();
};
containerDiv.find(".btnProjectTree").click(o.showProjectTree);
containerDiv.find(".btnProperties").click(o.showProperties);
containerDiv.find(".btnTypes").click(o.showTypes);
containerDiv.find(".btnLayers").click(o.showLayers);
containerDiv.find(".btnClassifications").click(o.showClassifications);
containerDiv.find(".btnQuery").click(o.showQuery);
}
</script>