Commit db578451 authored by Juan Corona's avatar Juan Corona

Small clean up to stay consistent with code style

parent a57ff80a
...@@ -187,15 +187,12 @@ function FrameSync($rootScope, $window, Discovery, annotationUI, bridge) { ...@@ -187,15 +187,12 @@ function FrameSync($rootScope, $window, Discovery, annotationUI, bridge) {
function destroyFrame(uri) { function destroyFrame(uri) {
var frames = annotationUI.frames(); var frames = annotationUI.frames();
var frameToDestroy; var frameToDestroy = frames.find(function (frame) {
for (var i = 0; i < frames.length; i++) { return frame.uri === uri;
var frame = frames[i]; });
if (frame.uri === uri) { if (frameToDestroy) {
frameToDestroy = frame; annotationUI.destroyFrame(frameToDestroy);
break;
}
} }
if (frameToDestroy) annotationUI.destroyFrame(frameToDestroy);
} }
/** /**
......
...@@ -19,7 +19,9 @@ var update = { ...@@ -19,7 +19,9 @@ var update = {
DESTROY_FRAME: function (state, action) { DESTROY_FRAME: function (state, action) {
var index = state.frames.indexOf(action.frame); var index = state.frames.indexOf(action.frame);
if (index >= 0) state.frames.splice(index, 1); if (index >= 0) {
state.frames.splice(index, 1);
}
return {frames: state.frames}; return {frames: state.frames};
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment