Implementing interstitial tiles

Interstitial tiles are fake slides and allow us to insert drag n drop
tiles between two other.
This commit is contained in:
Vince
2012-09-08 02:50:59 +02:00
parent 39b85e6092
commit c66ce4c9ad
6 changed files with 3151 additions and 16 deletions

View File

@ -96,6 +96,16 @@
this.frames.splice(index + 1, 0, frame.clone());
};
ns.FrameSheet.prototype.moveFrame = function(originIndex, destinationIndex) {
var frameToMove = this.getFrameByIndex(originIndex);
this.frames.splice(destinationIndex, 0,frameToMove);
if(destinationIndex <= originIndex) {
originIndex++;
}
this.removeFrameByIndex(originIndex);
};
ns.FrameSheet.prototype.swapFrames = function(indexFrame1, indexFrame2) {
if(isNaN(indexFrame1) || isNaN(indexFrame1) ||
(!this.hasFrameAtIndex(indexFrame1) && !this.hasFrameAtIndex(indexFrame2))) {