You're relying on DOM specific properties here, can you move this to dom.js or change this to not depend on that?