commit 4a765aacfa20cb5d07e2d9b9db81c0385140ed0d
parent 5100cd31edd6041bbb2ef95ecf4cb783c8d08a9e
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 26 Dec 2016 18:50:08 -0500
Fix selecting item and scrolling into view when editing a citation
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js
@@ -143,7 +143,7 @@ var Zotero_Citation_Dialog = new function () {
// and this fails. It works on subsequent attempts. Since this won't happen in
// Standalone, we can ignore.
var id = io.citation.citationItems[0].id;
- var selected = yield itemsView.selectItem(id);
+ let selected = yield collectionsView.selectItem(id);
for(var box in _preserveData) {
var property = _preserveData[box][0];
@@ -256,7 +256,7 @@ var Zotero_Citation_Dialog = new function () {
// refresh
if (itemID) {
- itemsView.wrappedJSObject.selectItem(itemID);
+ collectionsView.selectItem(itemID);
}
_updateAccept();
_updatePreview();
diff --git a/chrome/content/zotero/integration/addCitationDialog.xul b/chrome/content/zotero/integration/addCitationDialog.xul
@@ -78,7 +78,7 @@
<deck id="zotero-items-pane-content" selectedIndex="0" flex="1">
<tree id="zotero-items-tree"
enableColumnDrag="true" flex="1" seltype="single"
- onselect="Zotero_Citation_Dialog.treeItemSelected();">
+ onselect="onItemSelected(); Zotero_Citation_Dialog.treeItemSelected();">
<treecols id="zotero-items-columns-header">
<treecol
id="zotero-items-column-title" primary="true"
diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js
@@ -57,7 +57,7 @@ var doLoad = Zotero.Promise.coroutine(function* () {
yield connectionSelectedDeferred.promise;
if (io.select) {
- yield itemsView.selectItem(io.select);
+ yield collectionsView.selectItem(io.select);
}
Zotero.updateQuickSearchBox(document);
@@ -99,6 +99,7 @@ var onCollectionSelected = Zotero.Promise.coroutine(function* ()
clearItemsPaneMessage();
connectionSelectedDeferred.resolve();
+ collectionsView.onSelect();
}
});
@@ -113,7 +114,7 @@ function onSearch()
function onItemSelected()
{
-
+ itemsView.onSelect();
}
function setItemsPaneMessage(content) {