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