Okay I have this problem. I am using this variable in one function, but I have to reset it in another, but I'm not sure how to accomplish it.
My code looks like this:
var city_flag = null;
$(".button").click(function(){
var city = $(this).attr("id");
if(city_flag == city){
city_flag = null;
} else {
city_flag = city;
}
});
And than I got this: (coffescript)
$.fn.extend
somelistMap: (options) ->
// some settings here
// on init addCloseClickListenerToInfoWindow called
addCloseClickListenerToInfoWindow = (id) =>
google.maps.event.addListener markers[id]["infoWindow"], 'closeclick', =>
resetMap()
$(".city_tab").css("background", "none")
$(".all_dealers").removeClass("row_hide")
$(".all_dealers").addClass("row_show")
city_flag = null //Here i have to reset it
How can I get this to work? I tried putting city flag outside of the functions, but its not working!
EDIT: Forgot to mention environment is rails.. if that changes something
flagorcity_flagyou seem to be interchanging them