diff --git a/chrome/content/zotero/xpcom/prefs.js b/chrome/content/zotero/xpcom/prefs.js index e932db012a..5dcea8714e 100644 --- a/chrome/content/zotero/xpcom/prefs.js +++ b/chrome/content/zotero/xpcom/prefs.js @@ -230,6 +230,7 @@ Zotero.Prefs = new function(){ Zotero.setFontSize( Zotero.getActiveZoteroPane().document.getElementById('zotero-pane') ); + Zotero.setFontSize(Zotero.getActiveZoteroPane().document.getElementById('zotero-context-pane')); Zotero.getActiveZoteroPane().collectionsView && Zotero.getActiveZoteroPane().collectionsView.updateFontSize(); Zotero.getActiveZoteroPane().itemsView && Zotero.getActiveZoteroPane().itemsView.updateFontSize(); }], diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index e5344e0605..60e0f76c5d 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -85,6 +85,7 @@ class ReaderInstance { sidebarOpen: this._sidebarOpen, bottomPlaceholderHeight: this._bottomPlaceholderHeight, rtl: Zotero.rtl, + fontSize: Zotero.Prefs.get('fontSize'), localizedStrings: { ...Zotero.Intl.getPrefixedStrings('general.'), ...Zotero.Intl.getPrefixedStrings('pdfReader.') @@ -92,8 +93,17 @@ class ReaderInstance { }, [buf]); // Set title once again, because `ReaderWindow` isn't loaded the first time this.updateTitle(); + + this._prefObserverIDs = [ + Zotero.Prefs.registerObserver('fontSize', this._handleFontSizeChange) + ]; + return true; } + + uninit() { + this._prefObserverIDs.forEach(id => Zotero.Prefs.unregisterObserver(id)); + } get itemID() { return this._itemID; @@ -501,6 +511,10 @@ class ReaderInstance { || item.parentItem && item.parentItem.deleted; } + _handleFontSizeChange = () => { + this._postMessage({ action: 'setFontSize', fontSize: Zotero.Prefs.get('fontSize') }); + }; + _dataURLtoBlob(dataurl) { let parts = dataurl.split(','); let mime = parts[0].match(/:(.*?);/)[1]; @@ -1363,6 +1377,7 @@ class Reader { for (let id of ids) { let reader = Zotero.Reader.getByTabID(id); if (reader) { + reader.uninit(); this._readers.splice(this._readers.indexOf(reader), 1); } } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index c26366e288..932ffef185 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -99,6 +99,7 @@ var ZoteroPane = new function() var zp = document.getElementById('zotero-pane'); Zotero.setFontSize(zp); + Zotero.setFontSize(document.getElementById('zotero-context-pane')); ZoteroPane_Local.updateLayout(); ZoteroPane_Local.updateToolbarPosition(); this.updateWindow(); diff --git a/chrome/skin/default/zotero/contextPane.css b/chrome/skin/default/zotero/contextPane.css index 66c9054c84..13b7cf5b0b 100644 --- a/chrome/skin/default/zotero/contextPane.css +++ b/chrome/skin/default/zotero/contextPane.css @@ -34,6 +34,7 @@ #zotero-context-pane-inner { width: 0; font: message-box; + font-size: inherit; min-height: 100px; height: 100%; pointer-events: auto; diff --git a/pdf-reader b/pdf-reader index 2ee130e0ec..d391b6bb33 160000 --- a/pdf-reader +++ b/pdf-reader @@ -1 +1 @@ -Subproject commit 2ee130e0ecbbfe34807a5d5e2b3500ad6d99a57e +Subproject commit d391b6bb33a496c21f29cc4ebc737cd2dac29b8f