Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
fixing gallery drop down navigation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
brez committed Jun 28, 2011
1 parent d0bc11d commit 065673e
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 194 deletions.
4 changes: 2 additions & 2 deletions ff4/templates/things/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

<div id="gallery_wrapper">
<ul id="gallery-filter">
<li {% if featured == False %} class="active"{% endif %}><a href="/gallery/chap/1/1/"><span>{{ _('All') }}</span></a></li>
<li {% if featured == True %} class="active"{% endif %}><a href="/gallery/chap/1/1/featured"><span>{{ _('Featured') }}</span></a></li>
<li {% if featured == False %} class="active"{% endif %}><a href="/{{ LANG }}/gallery/chap/1/"><span>{{ _('All') }}</span></a></li>
<li {% if featured == True %} class="active"{% endif %}><a href="/{{ LANG }}/gallery/chap/1/featured"><span>{{ _('Featured') }}</span></a></li>
</div>
<div id="gallery_container">
{% include "things/_gallery_page.html" %}
Expand Down
25 changes: 7 additions & 18 deletions static/js/vendor/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// set the featuredOnly flag based on the presence of 'featured' in the url
$.webifyme.gallery.cfg.featuredOnly = !! $( this ).attr( 'href' ).match( /featured/ );
// reload the navigation and page contents
$.webifyme.gallery.fn.loadNavigation( '/gallery/chap/1/' );
$.webifyme.gallery.fn.loadNavigation( $( this ).attr( 'href') );
} );
},
'setupLinks': function() {
Expand All @@ -62,14 +62,6 @@
} );
},
'loadPage': function( href ) {
/* The Old
$('#gallery_container').fadeOut(ANIMATE_TIME, function() {
$('#gallery_container').load(href, attachLinkFunctions);
});
*/
// if we're only browsing featured content, append the featured flag to the url
if( $.webifyme.gallery.cfg.featuredOnly ) href = href + 'featured';
// fade out the current content
$( '#gallery_container' ).fadeOut( $.webifyme.gallery.cfg.animateTime, function() {
// and load in our new content, then run the link setup function again
Expand All @@ -80,21 +72,18 @@
} );
},
'loadNavigation': function( href ) {
/* The Old
$('.pagination').load($(this).attr('href'), attachLinkFunctions);
$('#gallery_container').fadeOut(ANIMATE_TIME, function() {
$('#gallery_container').load(href, attachLinkFunctions);
});
*/
// reference to the original href for passing to the loadPage function
var oHref = href;
if( $.webifyme.gallery.cfg.featuredOnly ) href = href + 'featured';
// reload the navigation
$( '.pagination' ).load( href, $.webifyme.gallery.fn.setupLinks );
// reload the page
$.webifyme.gallery.fn.loadPage( oHref + '1/' );
if($.webifyme.gallery.cfg.featuredOnly) {
$.webifyme.gallery.fn.loadPage( oHref.slice(0, oHref.length - 8)+ '1/featured' );
} else {
$.webifyme.gallery.fn.loadPage( oHref + '1/' );
}
}
}
};

}( jQuery ) );
}( jQuery ) );
Loading

0 comments on commit 065673e

Please sign in to comment.