Fixed incorrect duplicate layout JS function

Signed-off-by: Elliot Condon <e@elliotcondon.com>