Skip to content

Commit 2ebea09

Browse files
author
Fritz Lekschas
committed
Fixed chosen scroll bug.
1 parent 562d2e3 commit 2ebea09

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,18 @@ Unless otherwise stated content is licensed under [Creative Commons BY-SA 4.0][c
180180

181181
Copyright © 2012-2014 Lekschas et al.
182182

183-
### Reference
183+
### Publication
184184

185-
Lekschas et al. (2014) Semantic Body Browser: Graphical exploration of an
186-
organism and spatially resolved expression data visualisation.
187-
*Bioinformatics*, doi: 10.1093/bioinformatics/btu707.
185+
Lekschas et al. (2014) **Semantic Body Browser: Graphical exploration of an
186+
organism and spatially resolved expression data visualisation.**
187+
*Bioinformatics*, [doi: 10.1093/bioinformatics/btu707][doi].
188188

189189
[about]: http://sbb.cellfinder.org/about
190190
[ape]: https://httpd.apache.org/
191191
[bl]: https://github.com/eligrey/Blob.js
192192
[bo]: https://github.com/Pasvaz/bindonce
193193
[cc]: https://creativecommons.org/licenses/by-sa/4.0/
194+
[doi]: http://dx.doi.org/10.1093/bioinformatics/btu707
194195
[fbf]: https://github.com/johnpapa/angularjs-styleguide#application-structure-lift-principle
195196
[fs]: https://github.com/eligrey/FileSaver.js
196197
[gnu]: LICENSE

src/app/browser/directives/chosen.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ul class="hits">
2323
<li
2424
ng-repeat="hit in hits | limitTo:limit "
25-
ng-repeat-finish-render
25+
ng-repeat-finished
2626
ng-click="select($event)"
2727
ng-mouseenter="hover($index)"
2828
ng-bind-html="hit.with_hit"

src/app/browser/directives/chosen.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ angular
2121
$selection = $el.find('ul.selection'),
2222
$hits = $el.find('ul.hits'),
2323
hitsHeight,
24-
hitsOffsetTop,
24+
hitsOffsetTop = $hits.offset().top,
2525
bodyFont = $('body').css('font-family'),
2626
hitsFontSize = $hits.css('font-size'),
2727
hitsFontSizePx = parseInt($hits.css('font-size').slice(0, -2), 10);
@@ -393,14 +393,19 @@ angular
393393

394394
fn.checkScrollPos = function() {
395395
var el = $hits.find('li.selected'),
396-
elHeight = el.outerHeight(),
397-
elOffsetTop = el.offset().top;
396+
elHeight = el.outerHeight(),
397+
elOffsetTop = el.offset().top;
398398

399+
/*
400+
* Scroll Up
401+
*/
399402
if (elOffsetTop - hitsOffsetTop < 0) {
400403
$hits.scrollTop($hits.scrollTop() + elOffsetTop - hitsOffsetTop);
401404
}
402405

403-
// Scroll down
406+
/*
407+
* Scroll Down
408+
*/
404409
if (elOffsetTop - hitsOffsetTop + elHeight > hitsHeight) {
405410
$hits.scrollTop($hits.scrollTop() + elOffsetTop - hitsOffsetTop + elHeight - hitsHeight);
406411
}

0 commit comments

Comments
 (0)