From 0716eda75d9eab8cdef0ff4ae373c3a92c664ac6 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 30 Jan 2008 02:41:03 +0000 Subject: [PATCH] Fixes #812, Word plugin should remember last used collection Now shares pref with main Zotero interface Sean, open a new ticket if you think the pref should be stored in the Word document itself. --- chrome/content/zotero/selectItemsDialog.js | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js index 4ff61b93c..277445703 100644 --- a/chrome/content/zotero/selectItemsDialog.js +++ b/chrome/content/zotero/selectItemsDialog.js @@ -61,11 +61,26 @@ function onCollectionSelected() { var collection = collectionsView._getItemAtRow(collectionsView.selection.currentIndex); collection.setSearch(''); - - itemsView = new Zotero.ItemTreeView(collection, (window.arguments[1] ? true : false)); - document.getElementById('zotero-items-tree').view = itemsView; + + try { + Zotero.UnresponsiveScriptIndicator.disable(); + itemsView = new Zotero.ItemTreeView(collection, (window.arguments[1] ? true : false)); + document.getElementById('zotero-items-tree').view = itemsView; + } + finally { + Zotero.UnresponsiveScriptIndicator.enable(); + } + + if (collection.isLibrary()) { + Zotero.Prefs.set('lastViewedFolder', 'L'); + } + if (collection.isCollection()) { + Zotero.Prefs.set('lastViewedFolder', 'C' + collection.ref.getID()); + } + else if (collection.isSearch()) { + Zotero.Prefs.set('lastViewedFolder', 'S' + collection.ref.id); + } } - } function onSearch()