www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 0e31e7ca017d5d5b5fe2e42932d21883b5814cff
parent e4451d90025ad6c8a40c400fed43510d7846b7e8
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date:   Sat,  1 Nov 2014 19:43:41 -0500

Wait for the item pane to initialize before focusing first field

Diffstat:
Mchrome/content/zotero/zoteroPane.js | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -1971,6 +1971,7 @@ var ZoteroPane = new function() } var self = this; + var deferred = Zotero.Promise.defer(); this.collectionsView.addEventListener('load', function () { Zotero.spawn(function* () { var currentLibraryID = self.getSelectedLibraryID(); @@ -1993,15 +1994,22 @@ var ZoteroPane = new function() yield self.collectionsView.selectLibrary(item.libraryID); yield self.itemsView.selectItem(itemID, expand); } + deferred.resolve(true); + }) + .catch(function(e) { + deferred.reject(e); }); }); + }) + .catch(function(e) { + deferred.reject(e); }); }); // open Zotero pane this.show(); - return true; + return deferred.promise; });