mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Command buttons with additional properties
This commit is contained in:
parent
917a918220
commit
cf2ca6aa32
@ -3,8 +3,9 @@ define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'underscore',
|
||||
'Commands/CommandController'
|
||||
], function (App, Marionette, CommandController) {
|
||||
], function (App, Marionette, _, CommandController) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
template : 'Shared/Toolbar/ButtonTemplate',
|
||||
@ -30,8 +31,10 @@ define(
|
||||
|
||||
var command = this.model.get('command');
|
||||
if (command) {
|
||||
var properties = _.extend({ name: command }, this.model.get('properties'));
|
||||
|
||||
CommandController.bindToCommand({
|
||||
command: {name: command},
|
||||
command: properties,
|
||||
element: this.$el
|
||||
});
|
||||
}
|
||||
@ -51,7 +54,7 @@ define(
|
||||
invokeCommand: function () {
|
||||
var command = this.model.get('command');
|
||||
if (command) {
|
||||
CommandController.Execute(command);
|
||||
CommandController.Execute(command, this.model.get('properties'));
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user