-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamicFunctions.js
More file actions
61 lines (59 loc) · 2.41 KB
/
Copy pathdynamicFunctions.js
File metadata and controls
61 lines (59 loc) · 2.41 KB
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
$(document).ready(function() {
$(".draggableTile").draggable({
helper: 'clone',
stack: '.draggableTile',
cursor: 'pointer',
cursorAt: {top: 0, left: 0},
/**stop: function(event, ui) {
var tileIcon;
var tileTitle;
var image;
switch(ui.helper.attr('type')) {
case "label":
markerIcon = new DeviceIcon({iconUrl:'label.png'});
markerTitle = 'Label';
image = 'label.png';
break;
case "image":
markerIcon = new DeviceIcon({iconUrl:'image.png'});
markerTitle = 'Network Switch';
image = 'image.png';
break;
case "description":
markerIcon = new DeviceIcon({iconUrl:'description.png'});
markerTitle = 'Server';
image = 'description.png';
break;
case "poster":
markerIcon = new DeviceIcon({iconUrl:'poster.png'});
markerTitle = 'Computer';
image = 'poster.png';
break;
case "signUpList":
markerIcon = new DeviceIcon({iconUrl:'signupsheet.png'});
markerTitle = 'Printer';
image = 'signupsheet.png';
}
}*/
});
$(".canvas").droppable({
accept: ".draggableTile",
drop: function( event, ui ) {
console.log(event);
console.log(ui);
var tileType = ui.helper.attr('type');
console.log(tileType);
if(tileType === 'label') {
$(".canvas").append("<div class = 'labelTile form-group' style='position: fixed; left: "+ui.offset.left+"px; top: "+ui.offset.top+"px'><textarea class='form-control' rows='1'>Enter Label...</textarea></div>");
} else if (tileType === 'image') {
$(".canvas").append("<div class = 'labelTile' style='position: fixed; left: "+ui.offset.left+"px; top: "+ui.offset.top+"px'><img src='hackitsix.png' height='489' width='254'/></div>");
} else if (tileType === 'description') {
$(".canvas").append("<div class = 'labelTile form-group' style='position: fixed; left: "+ui.offset.left+"px; top: "+ui.offset.top+"px'><textarea class='form-control' rows='5'>Enter description...</textarea></div>");
} else if (tileType === 'poster') {
$(".canvas").append("<div class = 'labelTile' style='position: fixed; left: "+ui.offset.left+"px; top: "+ui.offset.top+"px'><img src='posterexample.png' height='355' width='440'/></div>");
} else if (tileType === 'signuplist') {
$(".canvas").append("<div class = 'labelTile' style='position: fixed; left: "+ui.offset.left+"px; top: "+ui.offset.top+"px'><textarea class='form-control' rows='8'>Sign up list:</textarea></div>");
}
}
});
});