commit 785f4f6663de324cb046087c165c384dd3b9533b parent 8e81c41ec0b44ba6b8e8c64cbde74e9f7531529c Author: Simon Kornblith <simon@simonster.com> Date: Thu, 31 Mar 2011 19:12:05 +0000 upgrade styles with the same title instead of offering to install a second style with the same title Diffstat:
| M | chrome/content/zotero/xpcom/style.js | | | 12 | ++++++++++++ |
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js @@ -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;