NIHVIVO-3283 - when using back button to navigate back to a menu page, the vclass previously selected will be selected

This commit is contained in:
tworrall 2012-05-09 20:08:01 +00:00
parent 733c45e330
commit 43db4d7416

View file

@ -48,6 +48,12 @@ var browseByVClass = {
return false; return false;
}); });
this.browseVClasses.children('li').each( function() {
$(this).find('a').click(function () {
// the extra space is needed to prevent odd scrolling behavior
location.hash = $(this).attr('data-uri') + ' ';
});
});
// Call the pagination listener // Call the pagination listener
this.paginationListener(); this.paginationListener();
}, },
@ -66,7 +72,12 @@ var browseByVClass = {
// Load individuals for default class as specified by menupage template // Load individuals for default class as specified by menupage template
defaultVClass: function() { defaultVClass: function() {
if ( this.defaultBrowseVClassURI != "false" ) { if ( this.defaultBrowseVClassURI != "false" ) {
this.getIndividuals(this.defaultBrowseVClassUri, "all", 1, false); if ( location.hash ) {
this.getIndividuals(location.hash.substring(1,location.hash.length - 1), "all", 1, false);
}
else {
this.getIndividuals(this.defaultBrowseVClassUri, "all", 1, false);
}
} }
}, },