From 6b9f9643da219d03d38f8c1125e836e5c6fdcbdb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 30 Sep 2010 22:00:45 +0000 Subject: [PATCH] Fixes #1158, Cannot drag item to tag with both automatic and manual versions And create a manual tag when dragging to an automatic tag in the tag selector --- .../content/zotero/bindings/tagselector.xml | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml index e6fb2bd30..d7954cc8f 100644 --- a/chrome/content/zotero/bindings/tagselector.xml +++ b/chrome/content/zotero/bindings/tagselector.xml @@ -726,15 +726,40 @@ function onDrop(event, dropData, session) { - event.target.setAttribute('draggedOver', false); + var node = event.target; + node.setAttribute('draggedOver', false); + + Zotero.DB.beginTransaction(); var ids = dropData.data.split(','); var items = Zotero.Items.get(ids); - var unlock = Zotero.Notifier.begin(true); - for each(var item in items) { - item.addTagByID(event.target.getAttribute('tagID')); + + // Find a manual tag if there is one + var tagID = null; + var tagIDs = node.getAttribute('tagID').split(/\-/); + var tagTypes = node.getAttribute('tagType').split(/\-/); + for (var i=0; i