| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | let thisFormId = 0; |
| 3 | 3 | |
| 4 | 4 | jQuery( document ).ready( function() { |
| 5 | 5 | const thisForm = document.getElementById( 'form_id' ); |
| 6 | - if ( thisForm !== null ) { | |
| 6 | + if ( thisForm ) { | |
| 7 | 7 | thisFormId = thisForm.value; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | // Only load on views settings page. |
| @@ -157,9 +157,9 @@ | ||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | function setMenuOffset() { |
| 160 | 160 | const fields = document.getElementById( 'frm_adv_info' ); |
| 161 | - if ( fields === null ) { | |
| 161 | + if ( ! fields ) { | |
| 162 | 162 | return; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | const currentOffset = document.documentElement.scrollTop || document.body.scrollTop; // body for Safari |
| @@ -168,9 +168,9 @@ | ||
| 168 | 168 | return; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | const posEle = document.getElementById( 'frm_position_ele' ); |
| 172 | - if ( posEle === null ) { | |
| 172 | + if ( ! posEle ) { | |
| 173 | 173 | return; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | const eleOffset = jQuery( posEle ).offset(); |
| @@ -178,9 +178,9 @@ | ||
| 178 | 178 | let desiredOffset = offset - currentOffset; |
| 179 | 179 | let menuHeight = 0; |
| 180 | 180 | |
| 181 | 181 | const menu = document.getElementById( 'wpadminbar' ); |
| 182 | - if ( menu !== null ) { | |
| 182 | + if ( menu ) { | |
| 183 | 183 | menuHeight = menu.offsetHeight; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if ( desiredOffset < menuHeight ) { |