upgrade styles with the same title instead of offering to install a second style with the same title

This commit is contained in:
Simon Kornblith 2011-03-31 19:12:05 +00:00
parent 8e81c41ec0
commit 785f4f6663

View File

@ -227,6 +227,18 @@ Zotero.Styles = new function() {
}
}
// also look for an existing style with the same title
if(!existingFile) {
var styleTitle = xml.info.title.toString();
for each(var existingStyle in this.getAll()) {
if(styleTitle === existingStyle.title) {
existingFile = existingStyle.file;
existingTitle = existingStyle.title;
break;
}
}
}
// display a dialog to tell the user we're about to install the style
if(hidden) {
destFile = destFileHidden;