| | 133 | |
| | 134 | // Attempt to work around a nasty long-standing bug with position: fixed in iOS Safari |
| | 135 | // set #wpadminbar to position: absolute while a text field or textarea has focus |
| | 136 | // (prevents it from jumping around and even covering the focused field) |
| | 137 | if ( /Mobile\/.+Safari/.test(window.navigator.userAgent) ) { |
| | 138 | $('input, textarea').focus(function(e){ |
| | 139 | $('#wpadminbar').css({left: 0, top: '-28px', position: 'absolute'}); |
| | 140 | |
| | 141 | |
| | 142 | // test only |
| | 143 | alert('#wpadminbar is position: absolute'); |
| | 144 | |
| | 145 | |
| | 146 | }).blur(function(e){ |
| | 147 | $('#wpadminbar').css({left: '', top: '', position: ''}); |
| | 148 | |
| | 149 | |
| | 150 | // test only |
| | 151 | alert('#wpadminbar is position: fixed'); |
| | 152 | |
| | 153 | }); |
| | 154 | } |