diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-08-11 22:03:39 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-08-11 22:03:39 +0200 |
commit | 13c57b69de3825cb7755f548a417dbd993f90bfb (patch) | |
tree | efcd23ee3d739372aad190ced846c5e9e7eff2e0 /pyload/web/app/scripts | |
parent | improved account list (diff) | |
download | pyload-13c57b69de3825cb7755f548a417dbd993f90bfb.tar.xz |
fixed account removing
Diffstat (limited to 'pyload/web/app/scripts')
4 files changed, 6 insertions, 6 deletions
diff --git a/pyload/web/app/scripts/models/Account.js b/pyload/web/app/scripts/models/Account.js index e2cc4f9ec..d98d3374f 100644 --- a/pyload/web/app/scripts/models/Account.js +++ b/pyload/web/app/scripts/models/Account.js @@ -51,7 +51,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'], function($ var options = App.apiRequest('updateAccountInfo', {account: this.toJSON()}, { success: function() { _.delay(function() { - App.vent.trigger('accounts:updated'); + App.vent.trigger('account:updated'); }, 1000); } }); diff --git a/pyload/web/app/scripts/views/accounts/accountListView.js b/pyload/web/app/scripts/views/accounts/accountListView.js index 4eb5bfe7d..37bfba964 100644 --- a/pyload/web/app/scripts/views/accounts/accountListView.js +++ b/pyload/web/app/scripts/views/accounts/accountListView.js @@ -24,7 +24,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'collections/AccountList', '. this.collection = new AccountList(); this.update(); - this.listenTo(App.vent, 'accounts:updated', this.update); + this.listenTo(App.vent, 'account:updated', this.update); }, update: function() { diff --git a/pyload/web/app/scripts/views/accounts/accountModal.js b/pyload/web/app/scripts/views/accounts/accountModal.js index 85db96b2b..31e05dff6 100644 --- a/pyload/web/app/scripts/views/accounts/accountModal.js +++ b/pyload/web/app/scripts/views/accounts/accountModal.js @@ -61,8 +61,8 @@ define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'hbs!tpl/dial $.ajax(App.apiRequest('updateAccount', { plugin: plugin, loginname: login, password: password - }, { success: function() { - App.vent.trigger('accounts:updated'); + }, { success: function(data) { + App.vent.trigger('account:updated', data); self.hide(); }})); } diff --git a/pyload/web/app/scripts/views/accounts/accountView.js b/pyload/web/app/scripts/views/accounts/accountView.js index 123327a27..f49deb0a6 100644 --- a/pyload/web/app/scripts/views/accounts/accountView.js +++ b/pyload/web/app/scripts/views/accounts/accountView.js @@ -12,7 +12,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/accounts/account'], 'click .btn-success': 'toggle', 'click .btn-blue': 'edit', 'click .btn-yellow': 'refresh', - 'click .btn-danger': 'remove' + 'click .btn-danger': 'deleteAccount' }, modelEvents: { @@ -41,7 +41,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/accounts/account'], this.model.fetch({refresh: true}); }, - remove: function() { + deleteAccount: function() { this.model.destroy(); } }); |