I take it that you copied this code from base.js. You can simplify it by removing the if check (in this context, modalCover will never have the class "is-fixed") and the comment above it.