www

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

commit 18fb9008554bbcc9712b74c18b175bd44ee92744
parent 4cd1dc039c8416b3b4566eb4a6be1922dce1f447
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu, 24 Feb 2011 04:56:10 +0000

closes  #1799: Dragging a file into the Zotero tab (but not pane) in Firefox 3.6 causes Firefox to try to load the file


Diffstat:
Mchrome/content/zotero/tab.js | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/tab.js b/chrome/content/zotero/tab.js @@ -42,7 +42,6 @@ var ZoteroTab = new function() ? this.containerWindow.gBrowser.tabs : this.containerWindow.gBrowser.mTabs); // loop over all browsers in this window - var containerTab, containerBrowser; for(var i=0; i<this.containerWindow.gBrowser.browsers.length; i++) { var currentBrowser = this.containerWindow.gBrowser.browsers[i]; if(currentBrowser.contentWindow == window) { @@ -58,6 +57,9 @@ var ZoteroTab = new function() } } + // stop drop events from propagating + this.containerBrowser.addEventListener("drop", _dropPropagationKiller, true); + // initialize ZoteroPane and swap out old window ZoteroPane object if(this.containerWindow.ZoteroPane) { this._swapZoteroPane(); @@ -107,12 +109,22 @@ var ZoteroTab = new function() } this.onUnload = function() { + // remove drop propagation killer + this.containerBrowser.removeEventListener("drop", _dropPropagationKiller, true); + + // replace window ZoteroPane if(this.containerWindow.ZoteroPane === this.containerWindow.ZoteroPane_Tab) { this.containerWindow.ZoteroPane = this.containerWindow.ZoteroPane_Overlay; } delete this.containerWindow.ZoteroPane_Tab; + + // destroy pane ZoteroPane.destroy(); } + + function _dropPropagationKiller(event) { + event.stopPropagation(); + } } window.addEventListener("load", function(e) { ZoteroTab.onLoad(e); }, false);