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

Naming in bounce.js #17

Open
fcampas opened this issue Mar 16, 2015 · 0 comments
Open

Naming in bounce.js #17

fcampas opened this issue Mar 16, 2015 · 0 comments

Comments

@fcampas
Copy link

fcampas commented Mar 16, 2015

Hey! Great project!
Im new to GitHub so I hope this is the correct place to post this. Love the webapp but Bounce.js is so crunk. Again, props bro.

I was experimenting with saving multiple instances of Bounce & then reapplying them to other elements. The object automatically gets renamed because in "Bounce.prototype.applyTo" the "this.define()" is passed without a name, so if you did have a name it gets ignored/reset.

I was kind of wondering if there was a reason behind this? Thanks.

Bounce.prototype.define = function(name) {
    this.name = name || Bounce.generateName();
    this.styleElement = document.createElement("style");
    this.styleElement.innerHTML = this.getKeyframeCSS({
      name: this.name,
      prefix: true
    });
    document.body.appendChild(this.styleElement);
    return this;
  };

  Bounce.prototype.applyTo = function(elements, options) {
    var css, deferred, element, prefix, prefixes, _i, _j, _len, _len1, _ref;
    if (options == null) {
      options = {};
    }
    this.define();
    if (!elements.length) {
      elements = [elements];
    }
    prefixes = this.getPrefixes();
    deferred = null;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant