CC-2301 : disallowing movement of first track in fade editor.

This commit is contained in:
Naomi 2013-04-24 15:32:48 -04:00
parent 179621d687
commit 0deaee4d0e
2 changed files with 14 additions and 3 deletions

View file

@ -64,7 +64,7 @@ TrackEditor.prototype.setWidth = function(width) {
this.width = width;
};
TrackEditor.prototype.init = function(src, start, end, fades, cues) {
TrackEditor.prototype.init = function(src, start, end, fades, cues, moveable) {
makePublisher(this);
@ -97,10 +97,15 @@ TrackEditor.prototype.init = function(src, start, end, fades, cues) {
this.selectedArea = undefined; //selected area of track stored as inclusive buffer indices to the audio buffer.
this.active = false;
this.canShift = moveable !== undefined ? moveable : true;
this.container.classList.add("channel-wrapper");
this.container.style.left = this.leftOffset;
if (this.canShift === false) {
this.container.style.position = "static";
}
this.drawer.drawLoading();
return this.container;
@ -132,7 +137,8 @@ TrackEditor.prototype.loadTrack = function(track) {
{
cuein: track.cuein,
cueout: track.cueout
}
},
track.moveable
);
this.loadBuffer(track.src);
@ -248,6 +254,10 @@ TrackEditor.prototype.timeShift = function(e) {
scroll = this.config.getTrackScroll(),
scrollX = scroll.left;
if (this.canShift === false) {
return; //setting the 'left' css property has no effect, but don't want internal variable leftOffset to update.
}
origX = editor.leftOffset / res;
//dynamically put an event on the element.