Don't fail when $NUMBER is missing in tag color chooser localized string
This commit is contained in:
parent
4ad8320dc0
commit
83dc2e0ad7
1 changed files with 9 additions and 3 deletions
|
@ -130,9 +130,15 @@ var Zotero_Tag_Color_Chooser = new function() {
|
|||
num.id = 'number-key';
|
||||
num.setAttribute('value', parseInt(tagPosition.value) + 1);
|
||||
|
||||
instructions.appendChild(document.createTextNode(matches[1]));
|
||||
instructions.appendChild(num);
|
||||
instructions.appendChild(document.createTextNode(matches[2]));
|
||||
if (matches) {
|
||||
instructions.appendChild(document.createTextNode(matches[1]));
|
||||
instructions.appendChild(num);
|
||||
instructions.appendChild(document.createTextNode(matches[2]));
|
||||
}
|
||||
// If no $NUMBER variable in translated string, fail as gracefully as possible
|
||||
else {
|
||||
instructions.appendChild(document.createTextNode(msg));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue