Skip to content

Commit

Permalink
Notify connector on translator update
Browse files Browse the repository at this point in the history
  • Loading branch information
adomasven committed Sep 7, 2017
1 parent cf5d87b commit 15502d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion chrome/content/zotero/xpcom/connector/connectorNotifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Zotero.ConnectorNotifier = {
_notifierID: null,

init: function() {
this._notifierID = Zotero.Notifier.registerObserver(this, ['collectionTreeRow', 'item'], 'Connector Notifier')
this._notifierID = Zotero.Notifier.registerObserver(this, ['collectionTreeRow', 'item', 'translators'], 'Connector Notifier')
},

notify: function(event, targetType, ids, extraData) {
Expand All @@ -46,6 +46,9 @@ Zotero.ConnectorNotifier = {
break;
}
}
if (event === 'modify' && targetType === 'translators') {
this.notifyListeners('translators', null);
}
},

_notifySelectItem: function() {
Expand Down
3 changes: 2 additions & 1 deletion chrome/content/zotero/xpcom/notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Zotero.Notifier = new function(){
var _types = [
'collection', 'search', 'share', 'share-items', 'item', 'file',
'collection-item', 'item-tag', 'tag', 'setting', 'group', 'trash',
'bucket', 'relation', 'feed', 'feedItem', 'sync', 'api-key', 'collectionTreeRow'
'bucket', 'relation', 'feed', 'feedItem', 'sync', 'api-key', 'collectionTreeRow',
'translators', 'styles'
];
var _inTransaction;
var _queue = {};
Expand Down
5 changes: 5 additions & 0 deletions chrome/content/zotero/xpcom/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,11 @@ Zotero.Schema = new function(){
}
_remoteUpdateInProgress = false;
}

if (updated) {
Zotero.Notifier.trigger('modify', 'styles', []);
Zotero.Notifier.trigger('modify', 'translators', []);
}

return updated;
});
Expand Down

0 comments on commit 15502d3

Please sign in to comment.