Update pinry tag handler and spinner

This commit is contained in:
Isaac Bythewood
2013-03-03 13:45:27 +00:00
parent 83f14445bf
commit eba04c177e
4 changed files with 16 additions and 13 deletions

View File

@@ -14,9 +14,13 @@ function renderTemplate(templateId, context) {
function cleanTags(tags) {
if (typeof tags === 'string') {
tags = tags.split(',');
for (var i in tags) tags[i] = tags[i].trim();
if (typeof tags === 'string' && tags.length > 0) {
tags = tags.split(/[\s,]+/);
for (var i in tags) {
tags[i] = tags[i].trim();
}
} else {
return null;
}
return tags;
}