Skip to content

Commit 8ed29f3

Browse files
Helgahlg
authored andcommitted
cleanup, fetch object details on selection
1 parent 4da1966 commit 8ed29f3

3 files changed

Lines changed: 15 additions & 51 deletions

File tree

Client/ThreeJsViewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function ThreeJsViewer(){
144144
if (this.selected) this.selected.materials[0].color.setHex(this.UNSELECTED_COLOR);
145145
this.selected = null;
146146
}
147-
this.onClick(this.selected ? this.meshes[this.selected.geometry.id] : 'nothing');
147+
this.onClick(this.selected ? this.meshes[this.selected.geometry.id] : null);
148148
};
149149

150150
this.animate = function() {

Client/index.html

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

Client/index_served.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,20 @@
6868
viewer = new ThreeJsViewer();
6969
viewer.init($('#viewerContainer'));
7070
viewer.onClick = function(id) {
71-
$('#selection').html(id);
71+
if (id==null) {
72+
$('#selection').html('nothing');
73+
return;
74+
}
75+
$.ajax({
76+
url: '/rest/getDataObjectByGuid',
77+
data: 'roid='+$('#roids').val()+'&guid='+id,
78+
success: function(data){
79+
var jqData = $(data);
80+
var name = jqData.find('name').text();
81+
var type = jqData.find('type').text();
82+
$('#selection').html(id + ' - ' + name + ' - ' + type);
83+
}
84+
});
7285
};
7386
viewer.animate();
7487
$('#login').submit(function() {

0 commit comments

Comments
 (0)