Skip to content

Commit

Permalink
Data-inview: Made plugin init more direct by removing the intermediar…
Browse files Browse the repository at this point in the history
…y event trigger
  • Loading branch information
pjackson28 committed Dec 23, 2013
1 parent 5f2c663 commit 2db985b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion src/plugins/data-inview/data-inview.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var pluginName = "wb-inview",

// Allow other plugins to run first
setTimeout(function() {
$elm.trigger( scrollEvent );
onInView( $elm );
}, 1 );
}
},
Expand Down
10 changes: 0 additions & 10 deletions src/plugins/data-inview/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ describe( "data-inview test suite", function() {
*/
describe( "init events", function() {

it( "should trigger a scroll.wb-inview event", function() {
expect( spy.calledWith( "scroll.wb-inview" ) ).to.equal( true );
});

it( "should have been triggered on a .wb-inview element", function() {
var elm,
isSelector = false,
Expand All @@ -62,12 +58,6 @@ describe( "data-inview test suite", function() {
}
expect( isSelector ).to.equal( true );
});

it( "should not reinitialize .wb-inview elements", function() {
spy.reset();
$( ".wb-inview" ).trigger( "init.wb-inview" );
expect( spy.calledWith( "scroll.wb-inview" ) ).to.equal( false );
});
});

/*
Expand Down

0 comments on commit 2db985b

Please sign in to comment.