From 39590ec9360b63f8c4ddaaa5874bffe80f9ea438 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 10 May 2012 13:38:08 +0000 Subject: [PATCH] fixed cross browser compatibility issue --- webapp/web/js/menupage/browseByVClass.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/web/js/menupage/browseByVClass.js b/webapp/web/js/menupage/browseByVClass.js index 875e2a86e..e22ef9c7d 100644 --- a/webapp/web/js/menupage/browseByVClass.js +++ b/webapp/web/js/menupage/browseByVClass.js @@ -48,12 +48,15 @@ var browseByVClass = { return false; }); + // save the selected vclass in location hash so we can reset the selection + // if the user navigates with the back button 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 this.paginationListener(); }, @@ -73,7 +76,9 @@ var browseByVClass = { defaultVClass: function() { if ( this.defaultBrowseVClassURI != "false" ) { if ( location.hash ) { - this.getIndividuals(location.hash.substring(1,location.hash.length - 1), "all", 1, false); + // remove the trailing white space + location.hash = location.hash.replace(/\s+/g, ''); + this.getIndividuals(location.hash.substring(1,location.hash.length), "all", 1, false); } else { this.getIndividuals(this.defaultBrowseVClassUri, "all", 1, false);