Skip to content

Commit

Permalink
g
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhellsing committed Dec 22, 2011
1 parent ed390c0 commit 11dc3d5
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions src/galleria.js
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ Galleria = function() {
lightbox.rescale();
});

$( lightbox.elems.overlay ).show();
$( lightbox.elems.overlay ).show().css( 'visibility', 'visible' );
$( lightbox.elems.box ).show();
}
};
Expand Down Expand Up @@ -2765,20 +2765,6 @@ Galleria.prototype = {

self._firstrun = true;

// bind clicknext
if ( self._options.clicknext && !Galleria.TOUCH ) {
$.each( self._data, function( i, data ) {
delete data.link;
});
self.$( 'stage' ).css({ cursor : 'pointer' }).bind( 'click', function(e) {
// pause if options is set
if ( self._options.pauseOnInteraction ) {
self.pause();
}
self.next();
});
}

// initialize the History plugin
if ( Galleria.History ) {

Expand Down Expand Up @@ -3700,7 +3686,10 @@ this.prependChild( 'info', 'myElement' );
active = this._controls.getActive(),
next = this._controls.getNext(),
cached = next.isCached( src ),
thumb = this._thumbnails[ queue.index ];
thumb = this._thumbnails[ queue.index ],
mousetrigger = function() {
$( next.image ).trigger( 'mouseup' );
};

// to be fired when loading & transition is complete:
var complete = (function( data, next, active, queue, thumb ) {
Expand Down Expand Up @@ -3737,12 +3726,21 @@ this.prependChild( 'info', 'myElement' );

// make the image link or add lightbox
// link takes precedence over lightbox if both are detected
if ( data.link || self._options.lightbox ) {
if ( data.link || self._options.lightbox || self._options.clicknext ) {

$( next.image ).css({
cursor: 'pointer'
}).bind( 'mouseup', function() {

// clicknext
if ( self._options.clicknext && !Galleria.TOUCH ) {
if ( self._options.pauseOnInteraction ) {
self.pause();
}
self.next();
return;
}

// popup link
if ( data.link ) {
if ( self._options.popupLinks ) {
Expand Down Expand Up @@ -3850,15 +3848,9 @@ this.prependChild( 'info', 'myElement' );
// show the layer now
if ( data.layer ) {
layer.show();
// inherit click events set on image or stage
if ( data.link || self._options.clicknext ) {
layer.css( 'cursor', 'pointer' ).one( 'click', function() {
if ( data.link ) {
$( next.image ).trigger( 'mouseup' );
} else {
self.$( 'stage' ).trigger( 'click' );
}
});
// inherit click events set on image
if ( data.link || self._options.lightbox || self._options.clicknext ) {
layer.css( 'cursor', 'pointer' ).unbind( 'mouseup' ).mouseup( mousetrigger );
}
}

Expand Down

0 comments on commit 11dc3d5

Please sign in to comment.