Permalink
Browse files

Data-inview: Tie the overlay close action to the dismiss close action…

… when the data-inview element is dismissable.
  • Loading branch information...
thomasgohard committed May 13, 2015
1 parent 77fa5c0 commit 7b5a8e024ecce771c93e6432e5bf98ffcf5d1e28
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/plugins/data-inview/data-inview.js
@@ -86,6 +86,20 @@ var componentName = "wb-inview",
return;
}
// Link the overlay close button to the dismiss action if the inview content is dismissable
if ( $elm.hasClass( "wb-dismissable" ) ) {
if ( $dataInView.hasClass( "wb-overlay" ) ) {
$dataInView.children( ".overlay-close" ).on( "click vclick", function( event ) {
var which = event.which;
// Ignore middle/right mouse buttons
if ( !which || which === 1 ) {
$elm.parent().siblings( ".content-dismiss" ).trigger( "click" );
}
} );
}
}
// Only if the view state has changed
if ( viewState !== oldViewState ) {

0 comments on commit 7b5a8e0

Please sign in to comment.