Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

layer delete updates

  • Loading branch information...
commit 3188bef726da41f5b7d573aeae15b2e006c9933f 1 parent 11c459a
@jbergen jbergen authored
View
7 web/js/app/models/editor.model.project.js
@@ -134,6 +134,7 @@
// if layer is persistent then remove ALL instances from frames
if( _.include( this.get('persistLayers'), parseInt(model.id) ) )
{
+ console.log('remove persistant layer')
_.each( _.toArray( this.frames.collection ), function(frame){
var newLayers = _.without( frame.get('layers'), parseInt(model.id) );
if( newLayers.length == 0 ) newLayers = [false];
@@ -148,6 +149,7 @@
}
else
{
+ console.log('remove single layer')
//remove from the current frame layer array
var layerArray = _.without( zeega.app.currentFrame.get('layers'), parseInt(model.id) );
if( layerArray.length == 0 ) layerArray = [false];
@@ -155,7 +157,10 @@
console.log(layerArray)
zeega.app.currentFrame.set('layers',layerArray);
- //zeega.app.currentFrame.save();
+ zeega.app.currentFrame.save();
+ console.log(zeega.app.currentFrame.get('layers'))
+ console.log( zeega.app.currentFrame );
+
this.destroyOrphanLayers();
}
},
View
3  web/js/app/views/editor.layer/editor.view.layer.layer-list.js
@@ -198,8 +198,7 @@
'mouseenter .layer-icon' : 'onLayerIconEnter',
'mouseleave .layer-icon' : 'onLayerIconLeave',
'mouseenter .delete-layer' : 'onLayerTrashEnter',
- 'mouseleave .delete-layer' : 'onLayerTrashLeave',
-
+ 'mouseleave .delete-layer' : 'onLayerTrashLeave'
},
// the events end users have access to
View
15 web/js/app/zeega.js
@@ -394,8 +394,8 @@ this.zeega = {
if( nextFrame != this.currentFrame )
{
- if(nextFrame.get('layers')) nextFrame.get('layers').push(parseInt(layerID));
- else nextFrame.set('layers',[parseInt(layerID)],{silent:true});
+ if(nextFrame.get('layers')) nextFrame.get('layers').push( parseInt(layerID) );
+ else nextFrame.set('layers',[ parseInt(layerID) ],{silent:true});
nextFrame.save();
}
}
@@ -565,21 +565,22 @@ this.zeega = {
getLeftFrame : function()
{
- var frameOrder = this.currentSequence.get('framesOrder') || this.currentSequence.frames.pluck('id');
+ var frameOrder = this.currentSequence.get('frames');
console.log('getLeft frame ----')
console.log(this.currentSequence)
console.log(frameOrder)
var currentFrameIndex = _.indexOf( frameOrder, parseInt(this.currentFrame.id) );
- if( currentFrameIndex ) return this.currentSequence.frames.get( frameOrder[ currentFrameIndex-1 ] );
- else return this.currentSequence.frames.get( frameOrder[1] );
+ if( currentFrameIndex ) return this.frames.get( frameOrder[ currentFrameIndex-1 ] );
+ else return this.frames.get( frameOrder[1] );
},
getRightFrame : function()
{
- var currentFrameIndex = _.indexOf( this.currentSequence.get('framesOrder'), this.currentFrame.id );
- if(currentFrameIndex < _.size( this.currentSequence.frames )-1 ) return this.currentSequence.frames.at( currentFrameIndex + 1 );
+ console.log(this)
+ var currentFrameIndex = _.indexOf( this.currentSequence.get('frames'), this.currentFrame.id );
+ if(currentFrameIndex < this.currentSequence.get('frames').length - 1 ) return this.project.frames.get( this.currentSequence.get('frames')[0] + 1 );
else return false;
},
Please sign in to comment.
Something went wrong with that request. Please try again.