Testing maybe final logic of this

This commit is contained in:
Falkvinge
2017-03-16 22:53:50 +01:00
parent b3c58edec9
commit 45249b735d
2 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ namespace Swarmops.Frontend.Socket
{
JObject malfunctionObject = new JObject();
malfunctionObject["Id"] = "Mal" + loop.ToString();
malfunctionObject["Text"] = malfunctionStrings[loop];
malfunctionObject["Text"] = malfunctionStrings[loop] + " (Test code, ignore)";
malfunctionsArray.Add(malfunctionObject);
}
+15 -13
View File
@@ -99,21 +99,23 @@ function updateListBox(box, listData) {
var listContainer = $(box).parent().parent();
var listElements = $(box).children();
listElements.each(function(index) {
console.log($(this));
var elementId = $(this).attr("rel");
console.log(elementId);
if (listElements.length > 0) {
listElements.children().each(function(index) {
console.log($(this));
var elementId = $(this).attr("rel");
console.log(elementId);
if (typeof idListLookup[elementId] != 'undefined') {
// displayed item is present in supplied list
// TODO: update text
} else {
// displayed item is NOT present in supplied list, and should be removed
$(this).slideUp(400, function() { $(this).remove(); });
}
});
if (typeof idListLookup[elementId] != 'undefined') {
// displayed item is present in supplied list
// TODO: update text
} else {
// displayed item is NOT present in supplied list, and should be removed
$(this).slideUp(400, function() { $(this).remove(); });
}
});
}
// Step 3: Iterate through list, add missing items
// Step 3: Iterate through list, add missing items
if (listElements.length == 0)
{