Fix checkmark in libraries-to-sync window on Windows
And switch to Unicode green checkmark and red prohibited characters on all platforms, which fixes #1675. The treecol checkmark stopped working on Windows in Fx60.
This commit is contained in:
parent
75076cf875
commit
6af5732fca
2 changed files with 14 additions and 4 deletions
|
@ -52,7 +52,7 @@
|
|||
onclick="Zotero_Preferences.Sync.clickLibraryToSync(event)"
|
||||
onkeyup="if (event.keyCode == event.DOM_VK_SPACE) { Zotero_Preferences.Sync.toggleLibraryToSync(this.currentIndex); }">
|
||||
<treecols>
|
||||
<treecol editable="true" type="checkbox" id="libraries-to-sync-checked" label="&zotero.preferences.sync.librariesToSync.sync;"/>
|
||||
<treecol editable="false" id="libraries-to-sync-checked" label="&zotero.preferences.sync.librariesToSync.sync;"/>
|
||||
<treecol editable="false" id="libraries-to-sync-name" flex="1" label="&zotero.preferences.sync.librariesToSync.library;"/>
|
||||
</treecols>
|
||||
<treechildren id="libraries-to-sync-rows"/>
|
||||
|
|
|
@ -29,6 +29,9 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
|||
Components.utils.import("resource://zotero/config.js");
|
||||
|
||||
Zotero_Preferences.Sync = {
|
||||
checkmarkChar: '\u2705',
|
||||
noChar: '\uD83D\uDEAB',
|
||||
|
||||
init: Zotero.Promise.coroutine(function* () {
|
||||
this.updateStorageSettingsUI();
|
||||
this.updateStorageSettingsGroupsUI();
|
||||
|
@ -273,6 +276,8 @@ Zotero_Preferences.Sync = {
|
|||
Zotero.Prefs.set('sync.librariesToSkip', JSON.stringify(librariesToSkip));
|
||||
|
||||
var cell = row.firstChild.firstChild;
|
||||
var spacing = Zotero.isMac ? ' ' : ' ';
|
||||
cell.setAttribute('label', spacing + (indexOfId != -1 ? this.checkmarkChar : this.noChar));
|
||||
cell.setAttribute('value', indexOfId != -1);
|
||||
},
|
||||
|
||||
|
@ -284,7 +289,7 @@ Zotero_Preferences.Sync = {
|
|||
treechildren.removeChild(treechildren.firstChild);
|
||||
}
|
||||
|
||||
function addRow(libraryName, id, checked=false, editable=true) {
|
||||
var addRow = function (libraryName, id, checked=false, editable=true) {
|
||||
var treeitem = document.createElement('treeitem');
|
||||
var treerow = document.createElement('treerow');
|
||||
var checkboxCell = document.createElement('treecell');
|
||||
|
@ -293,14 +298,19 @@ Zotero_Preferences.Sync = {
|
|||
nameCell.setAttribute('label', libraryName);
|
||||
nameCell.setAttribute('value', id);
|
||||
nameCell.setAttribute('editable', false);
|
||||
var spacing = Zotero.isMac ? ' ' : ' ';
|
||||
checkboxCell.setAttribute(
|
||||
'label',
|
||||
id == 'loading' ? '' : (spacing + (checked ? this.checkmarkChar : this.noChar))
|
||||
);
|
||||
checkboxCell.setAttribute('value', checked);
|
||||
checkboxCell.setAttribute('editable', editable);
|
||||
checkboxCell.setAttribute('editable', false);
|
||||
|
||||
treerow.appendChild(checkboxCell);
|
||||
treerow.appendChild(nameCell);
|
||||
treeitem.appendChild(treerow);
|
||||
treechildren.appendChild(treeitem);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
// Add loading row while we're loading a group list
|
||||
var loadingLabel = Zotero.getString("zotero.preferences.sync.librariesToSync.loadingLibraries");
|
||||
|
|
Loading…
Reference in a new issue