(refs #415) Fix bug

This commit is contained in:
Tomofumi Tanaka
2014-06-25 00:19:28 +09:00
parent a9bfe0dfab
commit 84a4b8fd92
3 changed files with 6 additions and 2 deletions

View File

@@ -99,7 +99,7 @@ $(function(){
$('#label-assigned').html($('<span>') $('#label-assigned').html($('<span>')
.append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName)) .append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName))
.append(' will be assigned')); .append(' will be assigned'));
$('a.assign[data-name=' + userName + '] i').attr('class', 'icon-ok'); $('a.assign[data-name=' + jqSelectorEscape(userName) + '] i').attr('class', 'icon-ok');
} }
$('input[name=assignedUserName]').val(userName); $('input[name=assignedUserName]').val(userName);
}); });

View File

@@ -116,7 +116,7 @@ $(function(){
.append($this.find('img.avatar').clone(false)).append(' ') .append($this.find('img.avatar').clone(false)).append(' ')
.append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName)) .append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName))
.append(' is assigned'); .append(' is assigned');
$('a.assign[data-name=' + userName + '] i').attr('class', 'icon-ok'); $('a.assign[data-name=' + jqSelectorEscape(userName) + '] i').attr('class', 'icon-ok');
} }
}); });
}); });

View File

@@ -102,4 +102,8 @@ function diffUsingJS(oldTextId, newTextId, outputId) {
contextSize: 4, contextSize: 4,
viewType: 1 viewType: 1
})); }));
}
function jqSelectorEscape(val) {
return val.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\$&');
} }