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) {
function destroyFrame(uri) {
var frames = annotationUI.frames();
var frameToDestroy;
for (var i = 0; i < frames.length; i++) {
var frame = frames[i];
if (frame.uri === uri) {
frameToDestroy = frame;
break;
}
var frameToDestroy = frames.find(function (frame) {
return frame.uri === uri;
});
if (frameToDestroy) {
annotationUI.destroyFrame(frameToDestroy);
}
if (frameToDestroy) annotationUI.destroyFrame(frameToDestroy);
}
/**
......
......@@ -19,7 +19,9 @@ var update = {
DESTROY_FRAME: function (state, action) {
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};
},
......
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