Fixed Bash Tag types not being shown in editor.

They were getting converted incorrectly, I forgot about Javascript's
object reference handling.
This commit is contained in:
Oliver Hamlet
2015-01-05 11:42:41 +00:00
parent 0348cd3866
commit 044ae322ab
+11 -6
View File
@@ -49,22 +49,27 @@ function Plugin(obj) {
/* Converts between the LOOT metadata object for tags, and their
editor row representation. */
Plugin.prototype.convTagObj = function(tag) {
var newTag = {
condition: tag.condition
};
if (tag.type) {
/* Input is row data. */
if (tag.type == 'remove') {
tag.name = '-' + tag.name;
newTag.name = '-' + tag.name;
} else {
newTag.name = tag.name;
}
delete tag.type;
} else {
/* Input is metadata object. */
if (tag.name[0] == '-') {
tag.type = 'remove';
tag.name = tag.name.substr(1);
newTag.type = 'remove';
newTag.name = tag.name.substr(1);
} else {
tag.type = 'add';
newTag.type = 'add';
newTag.name = tag.name;
}
}
return tag;
return newTag;
}
Plugin.prototype.getTagStrings = function() {