Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
buzinas authored Feb 25, 2018
2 parents 54bb702 + 794a0b3 commit c6e3f6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-scrollbar",
"version": "0.3.0",
"version": "0.3.1",
"description": "Very simple vanilla javascript library for creating a custom scrollbar cross-browser and cross-devices.",
"main": "simple-scrollbar.js",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion simple-scrollbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
display: none;
}

.ss-container:hover .ss-scroll {
.ss-container:hover .ss-scroll,
.ss-container:active .ss-scroll {
opacity: 1;
}

Expand Down
7 changes: 4 additions & 3 deletions simple-scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

function initEl(el) {
if (Object.prototype.hasOwnProperty.call(el, 'data-simple-scrollbar')) return;
Object.defineProperty(el, 'data-simple-scrollbar', new SimpleScrollbar(el));
Object.defineProperty(el, 'data-simple-scrollbar', { value: new SimpleScrollbar(el) });
}

// Mouse drag handler
Expand Down Expand Up @@ -48,7 +48,7 @@
function ss(el) {
this.target = el;

this.direction = window.getComputedStyle(this.target).direction;
this.direction = w.getComputedStyle(this.target).direction;

this.bar = '<div class="ss-scroll">';

Expand All @@ -75,12 +75,13 @@
dragDealer(this.bar, this);
this.moveBar();

w.addEventListener('resize', this.moveBar.bind(this));
this.el.addEventListener('scroll', this.moveBar.bind(this));
this.el.addEventListener('mouseenter', this.moveBar.bind(this));

this.target.classList.add('ss-container');

var css = window.getComputedStyle(el);
var css = w.getComputedStyle(el);
if (css['height'] === '0px' && css['max-height'] !== '0px') {
el.style.height = css['max-height'];
}
Expand Down
2 changes: 1 addition & 1 deletion simple-scrollbar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c6e3f6f

Please sign in to comment.