Skip to content

Commit

Permalink
use angular prop method for accessing element properties
Browse files Browse the repository at this point in the history
  • Loading branch information
yads committed Sep 26, 2014
1 parent 18a6ccb commit a51dec2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ng-tiny-scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ angular.module('ngTinyScrollbar', ['ngAnimate'])
};

this.update = function(scrollTo) {
this.viewportSize = $viewport[0]['offset'+ sizeLabelCap];
this.contentSize = $overview[0]['scroll'+ sizeLabelCap];
this.viewportSize = $viewport.prop('offset'+ sizeLabelCap);
this.contentSize = $overview.prop('scroll'+ sizeLabelCap);
this.contentRatio = this.viewportSize / this.contentSize;
this.trackSize = this.options.trackSize || this.viewportSize;
this.thumbSize = Math.min(this.trackSize, Math.max(0, (this.options.thumbSize || (this.trackSize * this.contentRatio))));
this.trackRatio = this.options.thumbSize ? (this.contentSize - this.viewportSize) / (this.trackSize - this.thumbSize) : (this.contentSize / this.trackSize);
mousePosition = $scrollbar[0].offsetTop;
mousePosition = $scrollbar.prop('offsetTop');

$scrollbar.toggleClass('disable', this.contentRatio >= 1);

Expand Down

0 comments on commit a51dec2

Please sign in to comment.