Skip to content
Browse files

Ensuring the active formfactor has an 'active' class

  • Loading branch information...
1 parent f5e46f0 commit 70fa017dd5a667272ade36fda48ffdcdd0c0a72c Paul Kinlan committed Apr 28, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 server/client/scripts/uis.js
View
8 server/client/scripts/uis.js
@@ -33,16 +33,22 @@ var factor = formfactor.detect([
]);
if(!!factor) {
+
+
+
$(document).ready(function() {
$("#formfactors a").live("click", function(e) {
formfactor.override($(this).data().formfactor, { path: "/" });
- window.location = window.location + "";
+ $("#formfactors a").removeClass("active");
+ $(this).addClass("active");
+ window.location.reload();
return false;
});
$("#formfactors").append("<a href=\"#\" data-formfactor=\"phone\">Phone</a>");
$("#formfactors").append("<a href=\"#\" data-formfactor=\"tablet\">Tablet</a>");
$("#formfactors").append("<a href=\"#\" data-formfactor=\"desktop\">Desktop</a>");
$("#formfactors").append("<a href=\"#\" data-formfactor=\"tv\">TV</a>");
+ $("#formfactors [data-formfactor="+factor+"]").addClass("active");
});
}

0 comments on commit 70fa017

Please sign in to comment.
Something went wrong with that request. Please try again.