mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
shared toolbar radio button style is working. just need to store state.
This commit is contained in:
parent
6636b77489
commit
fe554849c2
15 changed files with 183 additions and 142 deletions
38
UI/Shared/Toolbar/Radio/RadioButtonView.js
Normal file
38
UI/Shared/Toolbar/Radio/RadioButtonView.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
"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);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue