mirror of
https://github.com/zotero/zotero.git
synced 2026-09-21 00:22:44 +00:00
Use 11 instead of 6 on invalid note font size
Also don't validate font size until after pref field is blurred, to allow numbers to be typed in properly
This commit is contained in:
parent
bcc7a4ae86
commit
be49010783
4 changed files with 11 additions and 5 deletions
|
|
@ -441,13 +441,17 @@
|
|||
|
||||
// Add CSS rules to notes
|
||||
if (self.mode == 'note') {
|
||||
let fontSize = Zotero.Prefs.get('note.fontSize');
|
||||
// Fix empty old font prefs before a value was enforced
|
||||
if (fontSize < 6) {
|
||||
fontSize = 11;
|
||||
}
|
||||
var css = "body#zotero-tinymce-note.mceContentBody, "
|
||||
+ "body#zotero-tinymce-note.mceContentBody p, "
|
||||
+ "body#zotero-tinymce-note.mceContentBody th, "
|
||||
+ "body#zotero-tinymce-note.mceContentBody td, "
|
||||
+ "body#zotero-tinymce-note.mceContentBody pre { "
|
||||
+ "font-size: "
|
||||
+ Math.max(6, Zotero.Prefs.get('note.fontSize')) + "px; "
|
||||
+ "font-size: " + fontSize + "px; "
|
||||
+ "} "
|
||||
+ "body#zotero-tinymce-note.mceContentBody, "
|
||||
+ "body#zotero-tinymce-note.mceContentBody p { "
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ Zotero_Preferences.General = {
|
|||
statusBarRow.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('noteFontSize').value = Zotero.Prefs.get('note.fontSize');
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
<preferences id="zotero-prefpane-general-preferences">
|
||||
<preference id="pref-fontSize" name="extensions.zotero.fontSize" type="string"/>
|
||||
<preference id="pref-noteFontSize" name="extensions.zotero.note.fontSize" type="string"/>
|
||||
<preference id="pref-automaticScraperUpdates" name="extensions.zotero.automaticScraperUpdates" type="bool"/>
|
||||
<preference id="pref-reportTranslationFailure" name="extensions.zotero.reportTranslationFailure" type="bool"/>
|
||||
<preference id="pref-automaticSnapshots" name="extensions.zotero.automaticSnapshots" type="bool"/>
|
||||
|
|
@ -73,7 +72,8 @@
|
|||
<label value="&zotero.preferences.fontSize.notes;" control="noteFontSize"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<menulist id="noteFontSize" preference="pref-noteFontSize" editable="true">
|
||||
<menulist id="noteFontSize" editable="true"
|
||||
onblur="Zotero.Prefs.set('note.fontSize', this.value); this.value = Zotero.Prefs.get('note.fontSize');">
|
||||
<menupopup>
|
||||
<menuitem label="11"/>
|
||||
<menuitem label="12"/>
|
||||
|
|
|
|||
|
|
@ -2346,7 +2346,7 @@ Zotero.Prefs = new function(){
|
|||
case "note.fontSize":
|
||||
var val = this.get('note.fontSize');
|
||||
if (val < 6) {
|
||||
this.set('note.fontSize', 6);
|
||||
this.set('note.fontSize', 11);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue