- Revert async notifier change in r9341
- Better fix for excessive item saving activity - Fix for erroneous switch to library after adding an item to a collection (since r9341)
This commit is contained in:
parent
c7a44a6f37
commit
09e22e1e5d
3 changed files with 46 additions and 46 deletions
|
@ -2000,17 +2000,6 @@ Zotero.Item.prototype.save = function() {
|
|||
}
|
||||
}
|
||||
|
||||
//Zotero.History.commit();
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
|
||||
catch (e) {
|
||||
//Zotero.History.cancel();
|
||||
Zotero.DB.rollbackTransaction();
|
||||
Zotero.debug(e);
|
||||
throw(e);
|
||||
}
|
||||
|
||||
if (!this.id) {
|
||||
this._id = itemID;
|
||||
}
|
||||
|
@ -2050,8 +2039,19 @@ Zotero.Item.prototype.save = function() {
|
|||
|
||||
Zotero.Items.reload(this.id);
|
||||
|
||||
this._previousData = null;
|
||||
//Zotero.History.commit();
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
|
||||
catch (e) {
|
||||
//Zotero.History.cancel();
|
||||
Zotero.DB.rollbackTransaction();
|
||||
Zotero.debug(e);
|
||||
throw(e);
|
||||
}
|
||||
|
||||
// New items have to be reloaded via Zotero.Items.get(),
|
||||
// so mark them as disabled
|
||||
if (isNew) {
|
||||
var id = this.id;
|
||||
this._disabled = true;
|
||||
|
|
|
@ -471,11 +471,7 @@ var Zotero = new function(){
|
|||
|
||||
// Add notifier queue callbacks to the DB layer
|
||||
Zotero.DB.addCallback('begin', Zotero.Notifier.begin);
|
||||
Zotero.DB.addCallback('commit', function () {
|
||||
setTimeout(function () {
|
||||
Zotero.Notifier.commit();
|
||||
}, 1)
|
||||
});
|
||||
Zotero.DB.addCallback('commit', Zotero.Notifier.commit);
|
||||
Zotero.DB.addCallback('rollback', Zotero.Notifier.reset);
|
||||
|
||||
Zotero.Fulltext.init();
|
||||
|
|
|
@ -661,6 +661,8 @@ var ZoteroPane = new function()
|
|||
var itemGroup = null;
|
||||
}
|
||||
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
var item = new Zotero.Item(typeID);
|
||||
item.libraryID = libraryID;
|
||||
for (var i in data) {
|
||||
|
@ -672,6 +674,8 @@ var ZoteroPane = new function()
|
|||
itemGroup.ref.addItem(itemID);
|
||||
}
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
|
||||
//set to Info tab
|
||||
document.getElementById('zotero-view-item').selectedIndex = 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue