diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-09 12:26:33 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-09 12:26:33 +0200 |
commit | 22653e21a239afa8f29cf2c93afe28d21246e7ba (patch) | |
tree | cacee44aabacafe6ce35ce82a4e62afa7cdaab1e /apps/files/js/filelist.js | |
parent | 63fdaacbfcc8dbccca6777d623b6baadbd0ed56b (diff) | |
download | nextcloud-server-22653e21a239afa8f29cf2c93afe28d21246e7ba.tar.gz nextcloud-server-22653e21a239afa8f29cf2c93afe28d21246e7ba.zip |
Propagate file action changes to the file lists
Whenever an app needs to register an event late, it does that on the
original file actions object.
Since the file actions that the file list work on is a merged list, not
the original one, the registration event needs to be propagated there as
well.
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 3e311655c91..96436d33a2c 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -172,7 +172,8 @@ */ destroy: function() { // TODO: also unregister other event handlers - this.fileActions.removeUpdateListener(this._onFileActionsUpdated); + this.fileActions.off('registerAction', this._onFileActionsUpdated); + this.fileActions.off('setDefault', this._onFileActionsUpdated); }, _initFileActions: function(fileActions) { @@ -182,7 +183,8 @@ this.fileActions.registerDefaultActions(); } this._onFileActionsUpdated = _.debounce(_.bind(this._onFileActionsUpdated, this), 100); - this.fileActions.addUpdateListener(this._onFileActionsUpdated); + this.fileActions.on('registerAction', this._onFileActionsUpdated); + this.fileActions.on('setDefault', this._onFileActionsUpdated); }, /** |