Skip to content

Commit

Permalink
Merge pull request brutaldesign#266 from dperrymorrow/callbacksWithIndex
Browse files Browse the repository at this point in the history
adding index parameter to callback functions
  • Loading branch information
Constantin Saguin committed Mar 14, 2016
2 parents 90dcc4c + ab00120 commit f15e243
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/js/jquery.swipebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
this.preloadMedia( index+1 );
this.preloadMedia( index-1 );
if ( plugin.settings.afterOpen ) {
plugin.settings.afterOpen();
plugin.settings.afterOpen(index);
}
},

Expand Down Expand Up @@ -842,7 +842,7 @@
$this.setSlide( index );
$this.preloadMedia( index+1 );
if ( plugin.settings.nextSlide ) {
plugin.settings.nextSlide();
plugin.settings.nextSlide(index);
}
} else {

Expand All @@ -854,7 +854,7 @@
$this.setSlide( index );
$this.preloadMedia( index + 1 );
if ( plugin.settings.nextSlide ) {
plugin.settings.nextSlide();
plugin.settings.nextSlide(index);
}
} else {
$( '#swipebox-overlay' ).addClass( 'rightSpring' );
Expand All @@ -878,7 +878,7 @@
this.setSlide( index );
this.preloadMedia( index-1 );
if ( plugin.settings.prevSlide ) {
plugin.settings.prevSlide();
plugin.settings.prevSlide(index);
}
} else {
$( '#swipebox-overlay' ).addClass( 'leftSpring' );
Expand All @@ -888,11 +888,11 @@
}
},

nextSlide : function () {
nextSlide : function (index) {
// Callback for next slide
},

prevSlide : function () {
prevSlide : function (index) {
// Callback for prev slide
},

Expand Down Expand Up @@ -946,4 +946,4 @@

};

}( window, document, jQuery ) );
}( window, document, jQuery ) );

0 comments on commit f15e243

Please sign in to comment.