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