Skip to content

Commit

Permalink
Grid line labels corrected for Annotation Library
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Jun 5, 2014
1 parent 3941f65 commit 6f2bfa3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/annotationLibrary/annotationLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ baw.annotationLibrary.getBoundSettings = function getBoundSettings(audioEvent, c
format: "json"
};

audioEvent.media = Media.get(
Media.get(
mediaItemParameters,
function mediaGetSuccess(mediaValue, responseHeaders) {

Media.formatPaths(mediaValue);
mediaValue = new baw.Media(mediaValue);
audioEvent.media = mediaValue = new baw.Media(mediaValue);

// create properties that depend on Media
audioEvent.converters = unitConverter.getConversions({
Expand All @@ -80,6 +80,7 @@ baw.annotationLibrary.getBoundSettings = function getBoundSettings(audioEvent, c
};

// set common/sensible defaults, but hide the elements
var offsetOfDay = audioEvent.converters.input.audioRecordingAbsoluteStartDate.getSeconds();
audioEvent.gridConfig = {
y: {
showGrid: true,
Expand All @@ -96,8 +97,8 @@ baw.annotationLibrary.getBoundSettings = function getBoundSettings(audioEvent, c
x: {
showGrid: true,
showScale: true,
max: audioEvent.media.endOffset,
min: audioEvent.media.startOffset,
max: offsetOfDay + audioEvent.media.endOffset,
min: offsetOfDay + audioEvent.media.startOffset,
step: 1,
width: audioEvent.converters.conversions.enforcedImageWidth,
labelFormatter: function (value, index, min, max) {
Expand Down

0 comments on commit 6f2bfa3

Please sign in to comment.