diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 0c301991d3..dae65b6ae8 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -874,13 +874,11 @@ Zotero_Browser.Tab.prototype.getCaptureState = function () { * current page, or false if the page cannot be scraped */ Zotero_Browser.Tab.prototype.getCaptureIcon = function (hiDPI) { - var suffix = hiDPI ? "@2x" : ""; - switch (this.getCaptureState()) { case this.CAPTURE_STATE_TRANSLATABLE: var itemType = this.getPageObject().translators[0].itemType; return (itemType === "multiple" - ? "chrome://zotero/skin/treesource-collection" + suffix + ".png" + ? "chrome://zotero/skin/treesource-collection" + Zotero.hiDPISuffix + ".png" : Zotero.ItemTypes.getImageSrc(itemType)); default: @@ -890,8 +888,7 @@ Zotero_Browser.Tab.prototype.getCaptureIcon = function (hiDPI) { // TODO: Show icons for images, PDFs, etc.? Zotero_Browser.Tab.prototype.getWebPageCaptureIcon = function (hiDPI) { - var suffix = hiDPI ? "@2x" : ""; - return "chrome://zotero/skin/treeitem-webpage" + suffix + ".png"; + return "chrome://zotero/skin/treeitem-webpage" + Zotero.hiDPISuffix + ".png"; } Zotero_Browser.Tab.prototype.getCaptureTooltip = function() { diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 6eef83581f..166e866d6e 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -87,8 +87,9 @@ var ZoteroOverlay = new function() observerService.addObserver(zoteroObserver, "browser-delayed-startup-finished", false); - // Set a flag for hi-res displays + // Set flags for hi-res displays Zotero.hiDPI = window.devicePixelRatio > 1; + Zotero.hiDPISuffix = Zotero.hiDPI ? "@2x" : ""; // Clear old Zotero icon pref var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index c9418cf1fc..41d5a345a4 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -711,7 +711,7 @@ Zotero.CollectionTreeView.prototype.getCellText = function(row, column) Zotero.CollectionTreeView.prototype.getImageSrc = function(row, col) { - var suffix = Zotero.hiDPI ? "@2x" : ""; + var suffix = Zotero.hiDPISuffix; var treeRow = this.getRow(row); var collectionType = treeRow.type; diff --git a/chrome/content/zotero/xpcom/data/cachedTypes.js b/chrome/content/zotero/xpcom/data/cachedTypes.js index c81e0b0e78..b9691c29c0 100644 --- a/chrome/content/zotero/xpcom/data/cachedTypes.js +++ b/chrome/content/zotero/xpcom/data/cachedTypes.js @@ -441,7 +441,7 @@ Zotero.ItemTypes = new function() { } this.getImageSrc = function (itemType) { - var suffix = Zotero.hiDPI ? "@2x" : ""; + var suffix = Zotero.hiDPISuffix; if (this.isCustom(itemType)) { var id = this.getID(itemType) - this.customIDOffset; diff --git a/chrome/content/zotero/xpcom/data/collection.js b/chrome/content/zotero/xpcom/data/collection.js index e53cce0eff..c33cf6191d 100644 --- a/chrome/content/zotero/xpcom/data/collection.js +++ b/chrome/content/zotero/xpcom/data/collection.js @@ -91,8 +91,7 @@ Zotero.defineProperty(Zotero.Collection.prototype, 'collectionTreeViewID', { Zotero.defineProperty(Zotero.Collection.prototype, 'collectionTreeViewImage', { get: function () { - var suffix = Zotero.hiDPI ? "@2x" : ""; - return "chrome://zotero/skin/treesource-collection" + suffix + ".png"; + return "chrome://zotero/skin/treesource-collection" + Zotero.hiDPISuffix + ".png"; } }); diff --git a/chrome/content/zotero/xpcom/data/library.js b/chrome/content/zotero/xpcom/data/library.js index 24773f0b58..1f2cf7f3b9 100644 --- a/chrome/content/zotero/xpcom/data/library.js +++ b/chrome/content/zotero/xpcom/data/library.js @@ -182,8 +182,7 @@ Zotero.defineProperty(Zotero.Library.prototype, 'collectionTreeViewID', { Zotero.defineProperty(Zotero.Library.prototype, 'collectionTreeViewImage', { get: function () { - var suffix = Zotero.hiDPI ? "@2x" : ""; - return "chrome://zotero/skin/treesource-library" + suffix + ".png"; + return "chrome://zotero/skin/treesource-library" + Zotero.hiDPISuffix + ".png"; } });