1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

Toolbar/Actioneer callback cleanup

This commit is contained in:
Mark McDowall 2013-08-08 00:38:14 -07:00
parent 1df9c49c46
commit cdf34d5676
8 changed files with 22 additions and 23 deletions

View File

@ -32,7 +32,6 @@ namespace NzbDrone.Core.Datastore
void SetFields(TModel model, params Expression<Func<TModel, object>>[] properties); void SetFields(TModel model, params Expression<Func<TModel, object>>[] properties);
TModel Single(); TModel Single();
PagingSpec<TModel> GetPaged(PagingSpec<TModel> pagingSpec); PagingSpec<TModel> GetPaged(PagingSpec<TModel> pagingSpec);
void DeleteAll();
} }

View File

@ -31,7 +31,7 @@ public void Execute(TrimLogCommand message)
public void Execute(ClearLogCommand message) public void Execute(ClearLogCommand message)
{ {
_logRepository.DeleteAll(); _logRepository.Purge();
} }
} }
} }

View File

@ -78,7 +78,7 @@ define(
successMessage : 'Log files have been deleted', successMessage : 'Log files have been deleted',
errorMessage : 'Failed to delete log files', errorMessage : 'Failed to delete log files',
ownerContext : this, ownerContext : this,
successCallback: this._refreshLogs onSuccess: this._refreshLogs
} }
] ]
}; };

View File

@ -98,7 +98,7 @@ define(
successMessage : 'Logs have been cleared', successMessage : 'Logs have been cleared',
errorMessage : 'Failed to clear logs', errorMessage : 'Failed to clear logs',
ownerContext : this, ownerContext : this,
successCallback: this._refreshLogs onSuccess: this._refreshLogs
}, },
{ {

View File

@ -115,9 +115,9 @@ define(
this.model.set(name, !this.model.get(name)); this.model.set(name, !this.model.get(name));
Actioneer.SaveModel({ Actioneer.SaveModel({
context : this, context: this,
element : this.ui.seasonMonitored, element: this.ui.seasonMonitored,
alwaysCallback: this._afterSeasonMonitored always : this._afterSeasonMonitored
}); });
}, },

View File

@ -82,9 +82,9 @@ define(
this.model.set(name, !this.model.get(name), { silent: true }); this.model.set(name, !this.model.get(name), { silent: true });
Actioneer.SaveModel({ Actioneer.SaveModel({
context : this, context: this,
element : this.ui.monitored, element: this.ui.monitored,
alwaysCallback: this._setMonitoredState() always : this._setMonitoredState()
}); });
}, },
@ -116,7 +116,7 @@ define(
element : this.ui.refresh, element : this.ui.refresh,
leaveIcon : true, leaveIcon : true,
context: this, context: this,
successCallback: this._showSeasons onSuccess: this._showSeasons
}); });
}, },

View File

@ -30,8 +30,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
}); });
} }
if (options.successCallback) { if (options.onSuccess) {
options.successCallback.call(options.context); options.onSuccess.call(options.context);
} }
}); });
@ -47,8 +47,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
}); });
} }
if (options.failCallback) { if (options.onError) {
options.failCallback.call(options.context); options.onError.call(options.context);
} }
}); });
@ -63,8 +63,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
options.element.removeClass('icon-nd-spinner'); options.element.removeClass('icon-nd-spinner');
} }
if (options.alwaysCallback) { if (options.always) {
options.alwaysCallback.call(options.context); options.always.call(options.context);
} }
}); });
}, },

View File

@ -62,12 +62,12 @@ define(
}); });
} }
if (self.model.get('successCallback')) { if (self.model.get('onSuccess')) {
if (!self.model.ownerContext) { if (!self.model.ownerContext) {
throw 'ownerContext must be set.'; throw 'ownerContext must be set.';
} }
self.model.get('successCallback').call(self.model.ownerContext); self.model.get('onSuccess').call(self.model.ownerContext);
} }
}); });
@ -83,12 +83,12 @@ define(
}); });
} }
if (self.model.get('failCallback')) { if (self.model.get('onError')) {
if (!self.model.ownerContext) { if (!self.model.ownerContext) {
throw 'ownerContext must be set.'; throw 'ownerContext must be set.';
} }
self.model.get('failCallback').call(self.model.ownerContext); self.model.get('onError').call(self.model.ownerContext);
} }
}); });
@ -100,12 +100,12 @@ define(
} }
}); });
if (self.model.get('alwaysCallback')) { if (self.model.get('always')) {
if (!self.model.ownerContext) { if (!self.model.ownerContext) {
throw 'ownerContext must be set.'; throw 'ownerContext must be set.';
} }
self.model.get('alwaysCallback').call(self.model.ownerContext); self.model.get('always').call(self.model.ownerContext);
} }
} }
}, },