fix global variables pollution

This commit is contained in:
DIYgod 2016-01-17 13:49:51 +08:00
parent a77b723c6e
commit d50f90380b
3 changed files with 5 additions and 4 deletions

2
dist/APlayer.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "aplayer",
"version": "1.3.4",
"version": "1.3.5",
"description": "Wow, such a beautiful html5 music player",
"main": "dist/APlayer.min.js",
"scripts": {

View File

@ -42,10 +42,11 @@
this.element = this.option.element;
this.music = this.playIndex > -1 ? this.option.music[this.playIndex] : this.option.music;
var i;
// parser lrc
if (this.option.showlrc) {
var lrcs = [];
for (var i = 0; i < this.element.getElementsByClassName('aplayer-lrc-content').length; i++) {
for (i = 0; i < this.element.getElementsByClassName('aplayer-lrc-content').length; i++) {
lrcs.push(this.element.getElementsByClassName('aplayer-lrc-content')[i].innerHTML);
}
this.lrcs = this.parseLrc(lrcs);
@ -378,7 +379,7 @@
this.element.classList.add('aplayer-withlrc');
var lrcHTML = '';
this.lrcContents = this.element.getElementsByClassName('aplayer-lrc-contents')[0];
for (i = 0; i < this.lrc.length; i++) {
for (var i = 0; i < this.lrc.length; i++) {
lrcHTML += '<p>' + this.lrc[i][1] + '</p>';
}
this.lrcContents.innerHTML = lrcHTML;