Clear all tags in tag selector if a selected tag is removed via the tags pane
This commit is contained in:
parent
2db050290d
commit
fffe67967b
1 changed files with 13 additions and 2 deletions
|
@ -397,6 +397,12 @@ Zotero.Tag.prototype.save = function (full) {
|
|||
var done = 0;
|
||||
var maxItems = 998; // stay below compiled limit
|
||||
var numItems = removed.length;
|
||||
|
||||
var pairs = [];
|
||||
for each(var itemID in removed) {
|
||||
pairs.push(itemID + "-" + tagID);
|
||||
}
|
||||
|
||||
var tempRemoved = removed;
|
||||
|
||||
do {
|
||||
|
@ -409,12 +415,15 @@ Zotero.Tag.prototype.save = function (full) {
|
|||
done += chunk.length;
|
||||
}
|
||||
while (done < numItems);
|
||||
|
||||
Zotero.Notifier.trigger('remove', 'item-tag', pairs);
|
||||
}
|
||||
|
||||
if (newids.length) {
|
||||
var sql = "INSERT INTO itemTags (itemID, tagID) VALUES (?,?)";
|
||||
var insertStatement = Zotero.DB.getStatement(sql);
|
||||
|
||||
var pairs = [];
|
||||
for each(var itemID in newids) {
|
||||
insertStatement.bindInt32Parameter(0, itemID);
|
||||
insertStatement.bindInt32Parameter(1, tagID);
|
||||
|
@ -427,11 +436,13 @@ Zotero.Tag.prototype.save = function (full) {
|
|||
Zotero.debug("tagID: " + tagID);
|
||||
throw (e + ' [ERROR: ' + Zotero.DB.getLastErrorString() + ']');
|
||||
}
|
||||
|
||||
pairs.push(itemID + "-" + tagID);
|
||||
}
|
||||
|
||||
Zotero.Notifier.trigger('add', 'item-tag', pairs);
|
||||
}
|
||||
|
||||
//Zotero.Notifier.trigger('add', 'tag-item', this.id + '-' + itemID);
|
||||
|
||||
// TODO: notify linked items of name changes?
|
||||
Zotero.Notifier.trigger('modify', 'item', removed.concat(newids));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue