closes #1799: Dragging a file into the Zotero tab (but not pane) in Firefox 3.6 causes Firefox to try to load the file
This commit is contained in:
parent
4cd1dc039c
commit
18fb900855
1 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue