Skip to content

Commit

Permalink
optimize classname
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Sep 1, 2020
1 parent 99672fb commit c4d28d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zscroller",
"version": "0.6.7",
"version": "0.6.8",
"description": "dom scroller based on zynga scroller",
"keywords": [
"zynga scroller",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ZScroller {
if (!this._isShowScroll(k)) {
this._setScrollBarDisplay(k, 'none');
}
bar.className = `zscroller-scrollbar-${k}`;
bar.className = `zscroller-scrollbar zscroller-scrollbar-${k}`;
if (scrollerStyle.scrollbar) {
if (scrollerStyle.scrollbar.style) {
Object.assign(bar.style, scrollerStyle.scrollbar.style);
Expand Down Expand Up @@ -518,7 +518,7 @@ class ZScroller {

Object.keys(this._scrollbars).forEach(type => {
const bar = this._scrollbars[type];
this._bindEvent(bar, 'mousedown', (e) => {
this._bindEvent(bar, 'mousedown', e => {
if (e.button === 0) {
this._insideUserEvent = true;
this._onScrollbarMouseDown(e, type as Axis);
Expand Down Expand Up @@ -580,7 +580,7 @@ class ZScroller {
top: this._scroller.__scrollTop,
ratio: this._getRatio(),
};
this._indicators[type].classList.add(`zscroller-indicator-active`);
this._indicators[type].classList.add(`zscroller-indicator-active`, `zscroller-indicator-${type}-active`);
preventDefault(e);
e.stopPropagation();
}
Expand Down Expand Up @@ -611,7 +611,7 @@ class ZScroller {

_onIndicatorMouseUp(e: MouseEvent, type: Axis) {
this.__onIndicatorStartMouseMoving = false;
this._indicators[type].classList.remove(`zscroller-indicator-active`);
this._indicators[type].classList.remove(`zscroller-indicator-active`, `zscroller-indicator-${type}-active`);
document.body.removeAttribute('unselectable');
preventDefault(e);
e.stopPropagation();
Expand Down

0 comments on commit c4d28d6

Please sign in to comment.