Toolbar/Actioneer callback cleanup

pull/6/head
Mark McDowall 12 years ago
parent 1df9c49c46
commit cdf34d5676

@ -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();
} }

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

@ -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
} }
] ]
}; };

@ -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
}, },
{ {

@ -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
}); });
}, },

@ -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
}); });
}, },

@ -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);
} }
}); });
}, },

@ -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);
} }
} }
}, },

Loading…
Cancel
Save