Refactor view and css code around homepage links

This adds a new class to the body which we can use to do more styling
in CSS rather than erb-embedded Ruby. The only visual change is that
there's now a subtle transition for homepage links becoming active.
This commit is contained in:
Tom MacWright 2012-09-05 18:34:34 -04:00 committed by Tom Hughes
parent 7c0055b5d7
commit 02de53eb45
3 changed files with 105 additions and 71 deletions

View file

@ -58,11 +58,8 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj
args[objtype] = objid;
}
var classes = $(link).attr("class").split(" ");
$(classes).each(function (index, classname) {
if (match = classname.match(/^minzoom([0-9]+)$/)) {
var minzoom = match[1];
var minzoom = $(link).data("minzoom");
if (minzoom) {
var name = link.id.replace(/anchor$/, "");
$(link).off("click.minzoom");
@ -75,8 +72,7 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj
$(link).attr("title", I18n.t("javascripts.site." + name + "_disabled_tooltip"));
$(link).addClass("disabled");
}
}
});
}
link.href = setArgs(link.href, args);
});