1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Settings/Quality/Size/QualitySizeView.js

46 lines
1.3 KiB
JavaScript
Raw Normal View History

'use strict';
define(['marionette', 'Mixins/AsModelBoundView', 'jquery.knob'], function (Marionette, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template : 'Settings/Quality/Size/QualitySizeTemplate',
tagName : 'li',
ui: {
knob : '.x-knob',
2013-06-28 11:20:15 +03:00
thirtyMinuteSize: '.x-size-thirty',
sixtyMinuteSize : '.x-size-sixty'
},
events: {
2013-06-28 11:20:15 +03:00
// 'change .x-knob': '_changeMaxSize'
},
initialize: function (options) {
this.qualityProfileCollection = options.qualityProfiles;
2013-06-28 11:20:15 +03:00
this.model.on('change:maxSize', this._changeMaxSize, this)
},
onRender: function () {
this.ui.knob.knob({
2013-06-28 11:20:15 +03:00
min : 0,
max : 200,
step : 10,
cursor : 25,
width : 150,
stopper : true,
displayInput : false
});
},
2013-06-28 11:20:15 +03:00
_changeMaxSize: function (e) {
var value = this.model.get('maxSize');
this.ui.thirtyMinuteSize.html(value * 30);
this.ui.sixtyMinuteSize.html(value * 60);
}
});
return AsModelBoundView.call(view);
});