Fixed some issue

This commit is contained in:
Willem Dantuma
2020-03-03 10:21:24 +01:00
parent 5343a4aa98
commit a8f82f800f
4 changed files with 36 additions and 11 deletions

View File

@@ -194,10 +194,10 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
return state;
} else {
temporalLayer.previousItemLayer = temporalLayer.selectedItemLayer;
if( temporalLayer.previousItemLayer) temporalLayer.nextItemLayer.opacity=0;
if( temporalLayer.previousItemLayer) temporalLayer.previousItemLayer.opacity=0;
temporalLayer.selectedItemLayer = temporalLayer.nextItemLayer;
if( temporalLayer.selectedItemLayer) temporalLayer.selectedItemLayer.opacity=1;
temporalLayer.nextItemLayer = index+1 < temporalLayer.temporalItems.length? new ItemLayer(temporalLayer.temporalItems[index+1],0):null;
temporalLayer.nextItemLayer = index+2 < temporalLayer.temporalItems.length ? new ItemLayer(temporalLayer.temporalItems[index+2],0):null;
if( temporalLayer.nextItemLayer) temporalLayer.nextItemLayer.opacity=0;
return tassign(state,{selectedItemLayer:tassign(state.selectedItemLayer,temporalLayer as ItemLayer)});
}
@@ -216,8 +216,8 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
if( temporalLayer.nextItemLayer) temporalLayer.nextItemLayer.opacity=0;
temporalLayer.selectedItemLayer = temporalLayer.previousItemLayer;
if( temporalLayer.selectedItemLayer) temporalLayer.selectedItemLayer.opacity=1;
temporalLayer.previousItemLayer = index-1 >=0? new ItemLayer(temporalLayer.temporalItems[index-1]):null;
if( temporalLayer.previousItemLayer) temporalLayer.nextItemLayer.opacity=0;
temporalLayer.previousItemLayer = index-2 >=0? new ItemLayer(temporalLayer.temporalItems[index-2],0):null;
if( temporalLayer.previousItemLayer) temporalLayer.previousItemLayer.opacity=0;
return tassign(state,{selectedItemLayer:tassign(state.selectedItemLayer,temporalLayer as ItemLayer)});
}
} else {