Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Nov 7, 2013
1 parent 596b0d5 commit 8f63b1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/common/jquery.drawabox.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
// do not execute if no more boxs allowed
if (dataMouseDown.maxChildrenReached) {
// TODO: raise too-many-boxes event
console.warn("too many boxes, further addition of boxes disabled");
return;
}

Expand Down
9 changes: 6 additions & 3 deletions src/components/directives/bawAnnotationViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ bawds.directive('bawAnnotationViewer', [ 'conf.paths', function (paths) {

scope.$canvas.drawabox({
"selectionCallbackTrigger": "mousedown",

"newBox": function (element, newBox) {
var newAudioEvent = create(newBox, scope.model.audioRecording.id, scope);

Expand All @@ -235,11 +236,11 @@ bawds.directive('bawAnnotationViewer', [ 'conf.paths', function (paths) {
"boxSelected": function (element, selectedBox) {
console.log("boxSelected", selectedBox);

// support for multiple selections - remove the clear

scope.$apply(function () {
//scope.model.selectedAudioEvents.length = 0;
//scope.model.selectedAudioEvents.push(scope.model.audioEvents[element[0].annotationViewerIndex]);

// support for multiple selections - remove the clear
// TODO: this is a very inefficient method of achieving this result
angular.forEach(scope.model.audioEvents, function (value, key) {
value._selected = false;
});
Expand Down Expand Up @@ -283,6 +284,8 @@ bawds.directive('bawAnnotationViewer', [ 'conf.paths', function (paths) {
});
}
});


}
};
}]);
2 changes: 1 addition & 1 deletion src/components/services/angularjs-rails-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
token = $location.search().csrf;

if (!token) {
console.error("No temporary CSRF token has been found!");
console.warn("No temporary CSRF token has been found!");
}
$rootScope.csrfToken = token;
}
Expand Down

0 comments on commit 8f63b1d

Please sign in to comment.