Skip to content

Commit

Permalink
Working on touch handle styling. Also removed overflow scroll on spec…
Browse files Browse the repository at this point in the history
…trogram
  • Loading branch information
atruskie committed Jan 30, 2014
1 parent 1edee93 commit 60cfd99
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/annotationViewer/_annotation_viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ baw-annotation-viewer {

& #scroller{

overflow-x: scroll;
overflow-x: visible;
overflow-y: hidden;
line-height: 0;
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/annotationViewer/annotationViewer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var avModule = angular.module('bawApp.annotationViewer', []);

avModule.controller('AnnotationViewerCtrl', ['$scope', '$element', '$attrs', '$transclude', 'Tag',

// TODO: possible optimisation evaluate these functions once per frame

/**
* The AnnotationViewer controller
* @param $scope
Expand Down
6 changes: 5 additions & 1 deletion src/app/annotationViewer/annotationViewer.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
<img ng-src="{{model.media.spectrogram.url}}" src=""
ng-style="{width: model.converters.conversions.enforcedImageWidth, height: model.converters.conversions.enforcedImageHeight}">
<div id="spectrogramAnnotations_{{id}}" ></div>
<div class="positionLine" baw-translate-x="positionLine()" ng-class="{hidden: !model.audioElement.canPlay}" ></div>
<div class="positionLine" baw-translate-x="positionLine()"
ng-class="{hidden: !model.audioElement.canPlay}" >
<div class="grab-bottom-center"
></div>
</div>
</div>
</div>

Expand Down
76 changes: 68 additions & 8 deletions src/sass/touch/_touch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,46 @@
$btn-default-color: #333;
$handle-default-bg: #fff;
$handle-border-color: darken($handle-default-bg, 5%);
$smallest-size: 6px;

@mixin size($size) {
width: $size;
height: $size;

margin-left: -($size / 2.0);
margin-top: -($size / 2.0);
margin-right: -($size / 2.0);
margin-bottom: -($size / 2.0);

@include rounded-corners($size / 2.0);
}

.touch-handle-default {
@include size(6px);
@include size($smallest-size * 2.0);
}

.touch-handle-large {
@include size(6px);
.touch-handle-small {
@include size($smallest-size);
}

.touch-handle-largest {
@include size(6px);
.touch-handle-large {
@include size($smallest-size * 4.0);
}


.touch-handle {
background-color: $handle-default-bg;
border: solid 1px $handle-border-color;
margin:0;
padding: 0;

@extend .touch-handle-default;
// lib-sass currently does not support inherited extends
// so temporarily change this extend to a mixin
//@extend .touch-handle-default;
@include size($smallest-size * 2.0);

position: relative;
position: absolute;
z-index: 1000;
}

@mixin curved-tail {
Expand All @@ -55,7 +68,40 @@ $handle-border-color: darken($handle-default-bg, 5%);

}

.grab-center {
@extend .touch-handle;

top:50%;
left:50%;
}

.grab-left-center {
@extend .touch-handle;

top:50%;
left:0;
}

.grab-top-center {
@extend .touch-handle;

top:0;
left:50%;
}

.grab-right-center {
@extend .touch-handle;

top:50%;
right:0;
}

.grab-bottom-center {
@extend .touch-handle;

bottom:0;
left:50%;
}

.grab-top-left {
@extend .touch-handle;
Expand All @@ -71,6 +117,13 @@ $handle-border-color: darken($handle-default-bg, 5%);
right:0;
}

.grab-top-center {
@extend .touch-handle;

top:0;
left:50%;
}

.grab-bottom-left {
@extend .touch-handle;

Expand All @@ -83,4 +136,11 @@ $handle-border-color: darken($handle-default-bg, 5%);

bottom:0;
right:0;
}
}

.grab-bottom-centre {
@extend .touch-handle;

bottom:0;
left:0;
}

0 comments on commit 60cfd99

Please sign in to comment.