Dragndrop preview film tiles

- import go jquery-ui
- Basic implementation without styling
- only swapping is possible (no insertion)
This commit is contained in:
Vince
2012-09-07 23:14:25 +02:00
parent 022773d3ab
commit b824207d1d
5 changed files with 63 additions and 4 deletions

View File

@ -95,4 +95,19 @@
var frame = this.getFrameByIndex(index);
this.frames.splice(index + 1, 0, frame.clone());
};
ns.FrameSheet.prototype.swapFrames = function(indexFrame1, indexFrame2) {
if(isNaN(indexFrame1) || isNaN(indexFrame1) ||
(!this.hasFrameAtIndex(indexFrame1) && !this.hasFrameAtIndex(indexFrame2))) {
throw "Bad indexes for swapFrames Framesheet function.";
}
if(indexFrame1 == indexFrame2) {
return;
}
else {
var swapFrame = this.frames[indexFrame1];
this.frames[indexFrame1] = this.frames[indexFrame2];
this.frames[indexFrame2] = swapFrame;
}
};
})();