www

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

commit 9d648eeb2dd26e75a924d63427e86539c8a9f2df
parent f0bd8beebcb0384186d92788ed4b99ccb9d1dea3
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu,  8 Dec 2011 04:28:09 -0500

Merge branch '3.0' of github.com:zotero/zotero into 3.0

Diffstat:
Mchrome/content/zotero/xpcom/attachments.js | 20++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js @@ -328,11 +328,9 @@ Zotero.Attachments = new function(){ // if it fails // // TODO: index later - var timer = Components.classes["@mozilla.org/timer;1"]. - createInstance(Components.interfaces.nsITimer); - timer.initWithCallback({notify: function() { + setTimeout(function() { Zotero.Fulltext.indexItems([itemID]); - }}, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); + }, 1000); } catch (e) { // Clean up @@ -612,10 +610,9 @@ Zotero.Attachments = new function(){ // we'll index it later if it fails // // TODO: index later - var timer = Components.classes["@mozilla.org/timer;1"]. - createInstance(Components.interfaces.nsITimer); - timer.initWithCallback({notify: f}, 1000, - Components.interfaces.nsITimer.TYPE_ONE_SHOT); + setTimeout(function () { + f(); + }, 1000); } catch (e) { // Clean up @@ -652,10 +649,9 @@ Zotero.Attachments = new function(){ Zotero.Notifier.trigger('add', 'item', itemID); // Wait a second before indexing (see note above) - var timer = Components.classes["@mozilla.org/timer;1"]. - createInstance(Components.interfaces.nsITimer); - timer.initWithCallback({notify: f}, 1000, - Components.interfaces.nsITimer.TYPE_ONE_SHOT); + setTimeout(function () { + f(); + }, 1000); } // Caution: Take care using this itemID. The notifier may not yet have been called,