Difference between revisions of "Team:Cambridge-JIC/Templates/Menu"

Line 25: Line 25:
 
}
 
}
  
 +
String.prototype.endsWith = function(suffix) {
 +
    return ~this.indexOf(suffix, this.length - suffix.length);
 +
};
  
 
$(window).ready(function(){
 
$(window).ready(function(){
Line 124: Line 127:
 
if(!hr.match(/http:/g)) {
 
if(!hr.match(/http:/g)) {
  
if(~window.location.href.indexOf(hr)){
+
if(window.location.href.endsWith(hr)){
  
 
if(~$(this).parent().parent().prop('className').indexOf("nav")) {
 
if(~$(this).parent().parent().prop('className').indexOf("nav")) {

Revision as of 00:44, 4 August 2015