forked from bronwen-cassidy/mhag-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thoughts.txt
56 lines (46 loc) · 1.85 KB
/
thoughts.txt
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
The following is if we want to implement a popup dialog in the skillpanel.jsp to show the materials for each peice rather than the current
This popup will show the materials for the piece plus any jewels on the piece.
<script type="text/javascript" charset="UTF-8">
$(function() {
$( "#dialog" ).dialog({ autoOpen: false, modal: false, minHeight: 50, minWidth: 75 });
});
function close_dialog() {
$('#dialog').dialog('close');
return true;
}
$(function() {
$('.mats-display').click(function () {
var elemIdPart = $(this).attr("id").split("_")[0];
var selectedOp = $('#' + elemIdPart + 'select').find(":selected").val();
var pieces = selectedOp.split(':');
var pieceId = pieces[0];
if (pieceId != '---') {
var jewelStr = findJewelIds(elemIdPart);
// todo here ajax call to server
$('#dialog').dialog('open');
var myDialogX = $(this).offset().left;
var myDialogY = $(this).offset().top - $('.ui-dialog').height();
$('#dialog').dialog( 'option', 'position', [myDialogX, myDialogY]);
}
});
});
function findJewelIds(piece) {
var items = new Array();
$(".skill-select").each(function () {
var igvar = $(this).attr('disabled');
var elemId = $(this).attr('id');
var matches = elemId.indexOf(piece) != -1;
if (!igvar && matches) {
var selectedOp = $(this).find(":selected").val();
if (selectedOp != '---') {
items.push(selectedOp.split(":")[0]);
}
}
});
var itemsStr2;
if (items.length > 0) {
itemsStr2 = items.join(',');
}
return itemsStr2;
}
</script>