1
0
Fork 0
forked from 0x2620/oxjs

self.setOption ~> that.update

This commit is contained in:
j 2012-05-28 19:35:41 +00:00
commit 005d50c389
56 changed files with 919 additions and 933 deletions

View file

@ -27,6 +27,39 @@ Ox.SmallVideoTimeline = function(options, self) {
width: 256
})
.options(options || {})
.update({
duration: function() {
self.$image.options({duration: self.options.duration});
},
'in': function() {
self.$image.options({'in': self.options['in']});
self.options.mode == 'editor' && setPointMarker('in');
},
out: function() {
self.$image.options({out: self.options.out});
self.options.mode == 'editor' && setPointMarker('out');
},
paused: function() {
self.$positionMarker[
self.options.paused ? 'addClass' : 'removeClass'
]('OxPaused');
},
position: function() {
setPositionMarker();
},
results: function() {
self.$image.options({results: self.options.results});
},
state: function() {
self.$image.options({state: self.options.state});
},
subtitles: function() {
self.$image.options({subtitles: self.options.subtitles});
},
width: function() {
setWidth();
}
})
.addClass('OxSmallVideoTimeline')
.css(Ox.extend({
width: self.options.width + 'px'
@ -214,32 +247,6 @@ Ox.SmallVideoTimeline = function(options, self) {
}
}
self.setOption = function(key, value) {
if (key == 'duration') {
self.$image.options({duration: value});
} else if (key == 'in') {
self.$image.options({'in': value});
self.options.mode == 'editor' && setPointMarker('in');
} else if (key == 'out') {
self.$image.options({out: value});
self.options.mode == 'editor' && setPointMarker('out');
} else if (key == 'paused') {
self.$positionMarker[
self.options.paused ? 'addClass' : 'removeClass'
]('OxPaused');
} else if (key == 'position') {
setPositionMarker();
} else if (key == 'results') {
self.$image.options({results: value});
} else if (key == 'state') {
self.$image.options({state: value});
} else if (key == 'subtitles') {
self.$image.options({subtitles: value});
} else if (key == 'width') {
setWidth();
}
};
return that;
};