Updated JS to work with new Editor