mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
toolbar now saves its state for radio buttons.
This commit is contained in:
parent
76c383dfdd
commit
cf9f8b3f8a
5 changed files with 30 additions and 5 deletions
|
@ -1,15 +1,20 @@
|
|||
"use strict";
|
||||
define(['app'], function () {
|
||||
define(['app', 'Config'], function () {
|
||||
|
||||
NzbDrone.Shared.Toolbar.RadioButtonView = Backbone.Marionette.ItemView.extend({
|
||||
template : 'Shared/Toolbar/ButtonTemplate',
|
||||
className: 'btn',
|
||||
|
||||
events: {
|
||||
'click': 'invokeCallback'
|
||||
'click': 'onClick'
|
||||
},
|
||||
|
||||
|
||||
initialize: function () {
|
||||
|
||||
this.storageKey = this.model.get('menuKey') + ':' + this.model.get('key');
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
if (this.model.get('active')) {
|
||||
this.$el.addClass('active');
|
||||
|
@ -17,6 +22,12 @@ define(['app'], function () {
|
|||
}
|
||||
},
|
||||
|
||||
onClick: function () {
|
||||
|
||||
NzbDrone.Config.SetValue(this.model.get('menuKey'), this.model.get('key'));
|
||||
this.invokeCallback();
|
||||
},
|
||||
|
||||
invokeCallback: function () {
|
||||
|
||||
if (!this.model.ownerContext) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue