- Display Name
Step - Usability Attention Map Viewport Height [BB]
- Internal Name
E_STEP_USABILITY_ATTENTION_VIEWPORT_HEIGHT
- Advanced Mode only
- True
- Description
- Normalized Viewport height (min of Viewport or Page height)
- DisplayInPortal
- false
- Trigger
StepStart
JavaScript™: (Advanced Mode only)
// Step - Usability Attention Map Viewport Height [BB]
function roundToIncrement(input, increment) { var inc = increment * 1.0;
return Math.round(input / inc) * inc;
}
function %%NameSpace%%$%%InternalName%%()
{ if ($P["TL.STEP_CLIENTSTATE_EVENT"].firstValue().toUpperCase() ==
"ATTENTION" &&
$P["TL.STEP_CLIENTSTATE_VIEWPORT_HEIGHT"].patternFound())
{ var pageHeight =
parseInt($P["TL.STEP_CLIENTSTATE_PAGE_HEIGHT"].firstValue());
var viewportHeight =
parseInt($P["TL.STEP_CLIENTSTATE_VIEWPORT_HEIGHT"].firstValue());
var roundIncrement = 50;
viewportHeight = Math.min(viewportHeight, pageHeight);
viewportHeight = roundToIncrement(viewportHeight, roundIncrement);
// Set fact for Report Group: No Dimension Report Group
$F.setFact("%%NameSpace%%.%%Fact1%%", viewportHeight);
}
}