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