animo.js icon indicating copy to clipboard operation
animo.js copied to clipboard

Problem with cleanse function, solution

Open jordanchapian opened this issue 10 years ago • 5 comments

The cleanse function is passing a possibly undefined value into JQuery's .removeClass() function - This is causing a complete removal of all classes, and has caused some rather annoying behavior. Anyways, this is solved by changing the direct call to something like:

if(this.element.data("animo") != undefined) this.element.removeClass(this.element.data("animo"));

jordanchapian avatar Apr 05 '14 13:04 jordanchapian

:+1:

Just had exactly this problem with the cleanse function stripping out all my non-animo classes. Thanks for the solution, hopefully this will be implemented.

kellythedesigner avatar May 03 '14 23:05 kellythedesigner

Thanks @jordanchapian. I'll get this up within the next couple of days. Unless you have a pull request you want to submit

ThrivingKings avatar May 04 '14 11:05 ThrivingKings

Not a problem - I'll submit tonight.

jordanchapian avatar May 04 '14 13:05 jordanchapian

Found this thread after figuring out what the problem was ))

katrotz avatar Jun 06 '14 08:06 katrotz

@jordanchapian , thanks for solution.. just for your information on your fork, you have removed the code but i guess mistakenly made another line..

For those looking for solution in animo.js cleanse function should look like this:

cleanse: function() {
        this.element.removeClass('animated');
        this.element.removeClass(this.queue[0]);
        var ai = this.prefixes.length;
        while(ai--) {
...

gorkemgoknar avatar Apr 23 '15 18:04 gorkemgoknar