Skip to content

Commit

Permalink
fix aplayer-bar width
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Oct 11, 2016
1 parent 58a53e3 commit 89992c8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/APlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/APlayer.min.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/APlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class APlayer {
const sec = parseInt(second - min * 60);
const hours = parseInt(min / 60);
const minAdjust = parseInt((second / 60) - (60 * parseInt((second / 60) / 60)));
return second >= 3600? add0(hours) + ':' + add0(minAdjust) + ':' + add0(sec) : add0(min) + ':' + add0(sec);
return second >= 3600 ? add0(hours) + ':' + add0(minAdjust) + ':' + add0(sec) : add0(min) + ':' + add0(sec);
};

// save lrc
Expand Down Expand Up @@ -222,7 +222,6 @@ class APlayer {
// fix the width of aplayer bar
let bar = {};
bar.barWrap = this.element.getElementsByClassName('aplayer-bar-wrap')[0];
bar.barWrap.style.marginRight = this.element.getElementsByClassName('aplayer-time')[0].offsetWidth + 5 + 'px';

// switch to narrow style
if (this.option.narrow) {
Expand Down
9 changes: 6 additions & 3 deletions src/APlayer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;

.aplayer-controller {
position: relative;
display: flex;

.aplayer-bar-wrap {
margin: 0 140px 0 5px;
margin: 0 0 0 5px;
padding: 4px 0;
cursor: pointer !important;
flex: 1;

.aplayer-bar {
position: relative;
Expand Down Expand Up @@ -194,12 +196,13 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
}

.aplayer-time {
position: absolute;
position: relative;
right: 0;
bottom: -3px;
bottom: 3px;
height: 17px;
color: #999;
font-size: 11px;
padding-left: 7px;

.aplayer-time-inner {
vertical-align: middle;
Expand Down

0 comments on commit 89992c8

Please sign in to comment.