Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging Settings is not that perfect. #231

Open
libin2866 opened this issue Feb 17, 2017 · 1 comment
Open

Merging Settings is not that perfect. #231

libin2866 opened this issue Feb 17, 2017 · 1 comment

Comments

@libin2866
Copy link

First, audiojs is a great plugin, but there are still places to be improved.
e.g:
While I use
AudioJS.createAll({
createPlayer: {
loadingClass: 'audioloading'
}
});

The whole players createPlayer is just totally overwritten by the new option, not merge I mean.
It may because the object is just overwritten by a new one instead of merging the two.

if (options) this.helpers.merge(s, options);

this line need to add a extra merge for the createPlayer object

@libin2866
Copy link
Author

  if (options) {
      this.helpers.merge(s, options);
      if(options.createPlayer){
        this.helpers.merge(this.settings.createPlayer,options.createPlayer);
        this.helpers.merge(s.createPlayer,this.settings.createPlayer)
      }
  }

And this is my current solution(not that wise, but works).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant