Fix issue with modal plugin and using window as target