|
197 | 197 | } |
198 | 198 | }; |
199 | 199 |
|
| 200 | + /** |
| 201 | + * Reposition draggable windows when switched into fullscreen. |
| 202 | + * |
| 203 | + * @param {string} which 'transcript' or 'sign'. |
| 204 | + */ |
| 205 | + AblePlayer.prototype.rePositionDraggableWindow = function (which) { |
| 206 | + |
| 207 | + let preferences, $window; |
| 208 | + preferences = this.getPref(); |
| 209 | + $window = ( which === 'transcript' ) ? this.$transcriptArea : this.$signWindow; |
| 210 | + if ( which === 'transcript' ) { |
| 211 | + if (typeof preferences.transcript !== 'undefined') { |
| 212 | + this.prevTranscriptPosition = preferences.transcript; |
| 213 | + } |
| 214 | + $window.css({ |
| 215 | + 'top': 0, |
| 216 | + 'left': 0 |
| 217 | + }); |
| 218 | + } else { |
| 219 | + if (typeof preferences.sign !== 'undefined') { |
| 220 | + this.prevSignPosition = preferences.sign; |
| 221 | + } |
| 222 | + $window.css({ |
| 223 | + 'top': 0, |
| 224 | + 'right': 0, |
| 225 | + 'left': 'auto' |
| 226 | + }); |
| 227 | + } |
| 228 | + } |
| 229 | + |
200 | 230 | AblePlayer.prototype.positionDraggableWindow = function (which, width) { |
201 | 231 |
|
202 | 232 | // which is either 'transcript' or 'sign' |
|
208 | 238 | if (typeof preferences.transcript !== 'undefined') { |
209 | 239 | preferencePos = preferences.transcript; |
210 | 240 | } |
| 241 | + if ( this.prevTranscriptPosition ) { |
| 242 | + preferencePos = this.prevTranscriptPosition; |
| 243 | + this.prevTranscriptPosition = false; |
| 244 | + } |
211 | 245 | } else if (which === 'sign') { |
212 | 246 | if (typeof preferences.sign !== 'undefined') { |
213 | 247 | preferencePos = preferences.sign; |
214 | 248 | } |
| 249 | + if ( this.prevSignPosition ) { |
| 250 | + preferencePos = this.prevSignPosition; |
| 251 | + this.prevSignPosition = false; |
| 252 | + } |
215 | 253 | } |
216 | 254 | if (typeof preferencePos !== 'undefined' && !($.isEmptyObject(preferencePos))) { |
217 | 255 | // position window using stored values from preferences |
|
236 | 274 | }); |
237 | 275 | } |
238 | 276 | // If draggable window is off screen to the left. |
239 | | - if ( leftPosition < 0 ) { |
| 277 | + if ( leftPosition < 0 && ! this.restoringAfterFullscreen ) { |
| 278 | + console.log( leftPosition ); |
240 | 279 | $window.css({ |
241 | 280 | 'left': preferencePos['left'] - leftPosition |
242 | 281 | }); |
|
0 commit comments