You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
793 B
39 lines
793 B
12 years ago
|
"use strict";
|
||
|
define(['app'], function () {
|
||
|
|
||
|
NzbDrone.Shared.Toolbar.RadioButtonView = Backbone.Marionette.ItemView.extend({
|
||
|
template : 'Shared/Toolbar/ButtonTemplate',
|
||
|
className: 'btn',
|
||
|
|
||
|
events: {
|
||
|
'click': 'invokeCallback'
|
||
|
},
|
||
|
|
||
|
|
||
|
onRender: function () {
|
||
|
if (this.model.get('active')) {
|
||
|
this.$el.addClass('active');
|
||
|
this.invokeCallback();
|
||
|
}
|
||
|
},
|
||
|
|
||
|
invokeCallback: function () {
|
||
|
|
||
|
if (!this.model.ownerContext) {
|
||
|
throw 'ownerContext must be set.';
|
||
|
}
|
||
|
|
||
|
|
||
|
var callback = this.model.get('callback');
|
||
|
if (callback) {
|
||
|
callback.call(this.model.ownerContext);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|