only one router setTimeout function at a time - make it erase old functions if new one

This commit is contained in:
Devin Howard 2014-11-29 15:51:31 -05:00
parent fe3d280862
commit 739eba71bb

View file

@ -9,7 +9,7 @@ Metamaps.Views.init = function () {
template: Hogan.compile( $('#mapperCardTemplate').html() ),
tagName: "div",
tagNamea: "div",
className: "mapper",
@ -92,7 +92,8 @@ Metamaps.Views.init = function () {
Metamaps.Loading.hide();
setTimeout((function(localCurrentPage){ return function(){
clearTimeout(Metamaps.routerTimeoutFunctionIds);
Metamaps.routerTimeoutId = setTimeout((function(localCurrentPage){ return function(){
var path = (Metamaps.currentSection == "") ? "" : "/explore/" + localCurrentPage;
// alter url if for mapper profile page