Can I have more than one s.ActivityMap.regionIDAttribute

Avatar

Avatar

nicholasr284932

Avatar

nicholasr284932

nicholasr284932

04-03-2019

I recently changed my s.ActivityMap.regionIDAttribute to "region_id" but I still wanted activity map to default to "id" if "region_id" was not set. I thought this was the default behavior but I'm noticing activityMap returning a regionID of "BODY" when "region_id" is not defined. Can I pass an array or a delimited string to s.ActivityMap.regionIDAttribute to have it try "region_id" and then fall back to "id" or will it only ever take one identifier?

-- Nick

View Entire Topic

Avatar

Avatar

nicholasr284932

Avatar

nicholasr284932

nicholasr284932

13-08-2019

So what I finally ended up doing was below. It takes either the defined activitymap.regionIDAtttribute or uses "region_id". If it can't find either of those and hit 'id' first it uses that. All else fails it returns 'body'

   e.region = function (a) {

   for (var d, b = e.regionIDAttribute || "region_id"; a && (a = a.parentNode);) {

   if (d = q(a, b, b, b)) return d;

   if (d = q(a, 'id', 'id','id')) return d;

   if ("BODY" == a.nodeName) return "BODY"

  }

  }