Fix JS strict warning in overlay.js and error when right-clicking the browser content area before anything is selected in Zotero

This commit is contained in:
Dan Stillman 2007-07-16 21:52:28 +00:00
parent de6f35be6b
commit de4f449c45

View File

@ -942,7 +942,7 @@ var ZoteroPane = new function()
function reindexItem() { function reindexItem() {
var items = this.getSelectedItems(); var items = this.getSelectedItems();
if (!items) { if (!items) {
return false; return;
} }
for (var i=0; i<items.length; i++) { for (var i=0; i<items.length; i++) {
@ -1610,7 +1610,8 @@ var ZoteroPane = new function()
var showing = false; var showing = false;
if (menuitem){ if (menuitem){
var items = ZoteroPane.getSelectedItems(); var items = ZoteroPane.getSelectedItems();
if (ZoteroPane.itemsView.selection.count==1 && items[0] && items[0].isNote() if (ZoteroPane.itemsView.selection && ZoteroPane.itemsView.selection.count==1
&& items[0] && items[0].isNote()
&& window.gContextMenu.isTextSelected) && window.gContextMenu.isTextSelected)
{ {
menuitem.hidden = false; menuitem.hidden = false;