2013-03-07 08:01:18 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
|
2013-06-19 01:02:23 +00:00
|
|
|
|
define(['marionette', 'bootstrap.slider'], function (Marionette) {
|
2013-03-07 08:01:18 +00:00
|
|
|
|
|
2013-06-19 01:02:23 +00:00
|
|
|
|
return Marionette.ItemView.extend({
|
2013-03-29 23:28:58 +00:00
|
|
|
|
template : 'Settings/Quality/Size/QualitySizeTemplate',
|
2013-03-07 08:22:16 +00:00
|
|
|
|
className: 'quality-size-item',
|
2013-03-07 08:01:18 +00:00
|
|
|
|
|
|
|
|
|
ui: {
|
2013-03-29 23:28:58 +00:00
|
|
|
|
slider : '.slider',
|
2013-03-07 08:01:18 +00:00
|
|
|
|
thirtyMinuteSize: '.thirty-minute-size',
|
2013-03-29 23:28:58 +00:00
|
|
|
|
sixtyMinuteSize : '.sixty-minute-size'
|
2013-03-07 08:01:18 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
events: {
|
|
|
|
|
'slide .slider': 'slide'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initialize: function (options) {
|
|
|
|
|
this.qualityProfileCollection = options.qualityProfiles;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onRender: function () {
|
|
|
|
|
var self = this;
|
|
|
|
|
this.ui.slider.slider({
|
2013-03-29 23:28:58 +00:00
|
|
|
|
min : 0,
|
|
|
|
|
max : 200,
|
|
|
|
|
step : 1,
|
|
|
|
|
value : self.model.get('maxSize'),
|
2013-03-07 08:01:18 +00:00
|
|
|
|
tooltip: 'hide'
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
slide: function (e) {
|
|
|
|
|
var newSize = e.value;
|
|
|
|
|
|
|
|
|
|
this.model.set({ maxSize: newSize, thirtyMinuteSize: newSize * 30, sixtyMinuteSize: newSize * 60 });
|
|
|
|
|
|
|
|
|
|
this.ui.thirtyMinuteSize.html(newSize * 30);
|
|
|
|
|
this.ui.sixtyMinuteSize.html(newSize * 60);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|