1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +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);
TModel Single();
PagingSpec<TModel> GetPaged(PagingSpec<TModel> pagingSpec);
void DeleteAll();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,8 +30,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
});
}
if (options.successCallback) {
options.successCallback.call(options.context);
if (options.onSuccess) {
options.onSuccess.call(options.context);
}
});
@ -47,8 +47,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
});
}
if (options.failCallback) {
options.failCallback.call(options.context);
if (options.onError) {
options.onError.call(options.context);
}
});
@ -63,8 +63,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
options.element.removeClass('icon-nd-spinner');
}
if (options.alwaysCallback) {
options.alwaysCallback.call(options.context);
if (options.always) {
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) {
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) {
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) {
throw 'ownerContext must be set.';
}
self.model.get('alwaysCallback').call(self.model.ownerContext);
self.model.get('always').call(self.model.ownerContext);
}
}
},