fix tag selector in Zotero tab
This commit is contained in:
parent
e44e44b222
commit
9c6be2c0eb
2 changed files with 10 additions and 7 deletions
|
@ -246,9 +246,9 @@
|
|||
label.setAttribute('tagType', this._tags[tagID].type);
|
||||
if (this.editable) {
|
||||
label.setAttribute('context', 'tag-menu');
|
||||
label.setAttribute('ondragover', 'return document.getBindingParent(this).dragObserver.onDragOver(event)');
|
||||
label.setAttribute('ondragexit', 'return document.getBindingParent(this).dragObserver.onDragExit(event)');
|
||||
label.setAttribute('ondrop', 'return document.getBindingParent(this).dragObserver.onDrop(event)');
|
||||
label.addEventListener('dragover', this.dragObserver.onDragOver, false);
|
||||
label.addEventListener('dragexit', this.dragObserver.onDragExit, false);
|
||||
label.addEventListener('drop', this.dragObserver.onDrop, true);
|
||||
}
|
||||
tagsToggleBox.appendChild(label);
|
||||
}
|
||||
|
@ -698,8 +698,9 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
this.onDragOver = function (event) {
|
||||
Zotero.debug(event.dataTransfer.mozTypesAt(0));
|
||||
if (!event.dataTransfer.getData('zotero/item')) {
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -714,7 +715,8 @@
|
|||
*/
|
||||
|
||||
event.target.setAttribute('draggedOver', true);
|
||||
return false;
|
||||
event.preventDefault();
|
||||
event.effectAllowed = event.dropEffect = "link";
|
||||
}
|
||||
|
||||
this.onDragExit = function (event) {
|
||||
|
|
|
@ -58,7 +58,7 @@ var ZoteroTab = new function()
|
|||
}
|
||||
|
||||
// stop drop events from propagating
|
||||
this.containerBrowser.addEventListener("drop", _dropPropagationKiller, true);
|
||||
this.containerBrowser.addEventListener("drop", _dropPropagationKiller, false);
|
||||
|
||||
// initialize ZoteroPane and swap out old window ZoteroPane object
|
||||
if(this.containerWindow.ZoteroPane) {
|
||||
|
@ -110,7 +110,7 @@ var ZoteroTab = new function()
|
|||
|
||||
this.onUnload = function() {
|
||||
// remove drop propagation killer
|
||||
this.containerBrowser.removeEventListener("drop", _dropPropagationKiller, true);
|
||||
this.containerBrowser.removeEventListener("drop", _dropPropagationKiller, false);
|
||||
|
||||
// replace window ZoteroPane
|
||||
if(this.containerWindow.ZoteroPane === this.containerWindow.ZoteroPane_Tab) {
|
||||
|
@ -124,6 +124,7 @@ var ZoteroTab = new function()
|
|||
|
||||
function _dropPropagationKiller(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue