Disable key navigation on 1-6 keys if any tag colors are assigned
Previously any unused numbers were still available for key navigation, but I think it's too easy hit the wrong key that way, and getting moved to another part of the items list is annoying.
This commit is contained in:
parent
3faa8949ef
commit
a1197883bb
1 changed files with 6 additions and 3 deletions
|
@ -188,10 +188,13 @@ Zotero.ItemTreeView.prototype._setTreeGenerator = function(treebox)
|
||||||
let position = parseInt(key) - 1;
|
let position = parseInt(key) - 1;
|
||||||
return Zotero.Tags.getColorByPosition(libraryID, position)
|
return Zotero.Tags.getColorByPosition(libraryID, position)
|
||||||
.then(function (colorData) {
|
.then(function (colorData) {
|
||||||
// If a color isn't assigned to this number, allow key navigation,
|
// If a color isn't assigned to this number or any
|
||||||
// though I'm not sure this is a good idea.
|
// other numbers, allow key navigation
|
||||||
if (!colorData) {
|
if (!colorData) {
|
||||||
return true;
|
return Zotero.Tags.getColors(libraryID)
|
||||||
|
.then(function (colors) {
|
||||||
|
return !Object.keys(colors).length;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var items = self.getSelectedItems();
|
var items = self.getSelectedItems();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue