Skip to content

Commit

Permalink
fix: use prefix helper for animation-name cleansing
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Jan 5, 2016
1 parent ddb1b21 commit 964e5cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions source/library/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import getPlayer from './get-player';
import getMediaqueryMedia from './get-mediaquery-media';
import {prefix} from './get-vendor-prefix';

class JogWheel {
/**
Expand Down Expand Up @@ -298,7 +299,7 @@ class JogWheel {
* // Unplug and plug again to read new styling information
* wheel.unplug().plug();
*/
unplug() {
unplug(window = global.window, document = global.document) {
const {medias, elements, players} = this.__instance;

// Cancel all players
Expand All @@ -307,9 +308,8 @@ class JogWheel {
// Remove former matchMedia callbacks
medias.forEach(media => media.removeListener(this.onMatchMedia));

// TODO: Cross browser
// Clean up element animationName reset
elements.map(element => element.style.animationName = '');
elements.map(element => element.style[prefix('animationName', window, document)] = '');

// Cleanse state
this.__instance = {
Expand Down
2 changes: 1 addition & 1 deletion source/test/unit/jogwheel-instance-unplug.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import jogwheel from '../../library/';
tape('instance.unplug', t => {
const instance = jogwheel.create(elementStub, {}, windowStub, documentStub);
t.ok(
instance.unplug() === instance,
instance.unplug(windowStub, documentStub) === instance,
'should return the jogwheel instance'
);
t.end();
Expand Down

0 comments on commit 964e5cf

Please sign in to comment.