|
2 | 2 | tinymce.PluginManager.add( 'block', function( editor ) { |
3 | 3 | var getSelectedBlock = wp.blocks.getSelectedBlock; |
4 | 4 | var getSelectedBlocks = wp.blocks.getSelectedBlocks; |
| 5 | + var editorPadding = 50; |
5 | 6 |
|
6 | 7 | // Global controls |
7 | 8 |
|
|
234 | 235 | if ( settings.isEmpty ) { |
235 | 236 | DOM.setStyles( toolbar, { |
236 | 237 | position: 'absolute', |
237 | | - left: contentRect.left + 50 + 'px', |
| 238 | + left: contentRect.left + 'px', |
238 | 239 | top: blockRect.top + 3 + window.pageYOffset + 'px' |
239 | 240 | } ); |
240 | 241 | } else { |
241 | 242 | if ( isFullBleed ) { |
242 | | - var left = contentRect.left + 50; |
| 243 | + var left = contentRect.left; |
243 | 244 | } else { |
244 | 245 | var left = blockRect.left - 6; |
245 | 246 | } |
|
288 | 289 |
|
289 | 290 | DOM.setStyles( toolbar, { |
290 | 291 | position: 'absolute', |
291 | | - left: contentRect.left + 100 + 'px', |
| 292 | + left: contentRect.left + editorPadding + 'px', |
292 | 293 | top: elementRect.top + window.pageYOffset + 'px' |
293 | 294 | } ); |
294 | 295 |
|
|
309 | 310 |
|
310 | 311 | DOM.setStyles( toolbar, { |
311 | 312 | position: 'absolute', |
312 | | - left: Math.max( contentRect.left + 100, elementRect.left ) + 8 + blockToolbarWidth + 'px', |
| 313 | + left: Math.max( contentRect.left + editorPadding, elementRect.left ) + 8 + blockToolbarWidth + 'px', |
313 | 314 | top: elementRect.top + window.pageYOffset - toolbarRect.height - 8 + 'px' |
314 | 315 | } ); |
315 | 316 |
|
|
334 | 335 | var contentRect = editor.getBody().getBoundingClientRect(); |
335 | 336 |
|
336 | 337 | if ( isRightAligned ) { |
337 | | - var left = contentRect.right - toolbarRect.width - 50; |
| 338 | + var left = contentRect.right - toolbarRect.width; |
338 | 339 | } else { |
339 | | - var left = contentRect.left + 50 |
| 340 | + var left = contentRect.left; |
340 | 341 | } |
341 | 342 |
|
342 | 343 | if ( isFullBleed ) { |
|
372 | 373 |
|
373 | 374 | DOM.setStyles( toolbar, { |
374 | 375 | position: 'absolute', |
375 | | - left: Math.max( contentRect.left + 100, elementRect.left ) + 'px', |
| 376 | + left: Math.max( contentRect.left + editorPadding, elementRect.left ) + 'px', |
376 | 377 | top: elementRect.top + window.pageYOffset - toolbarRect.height - 8 + 'px' |
377 | 378 | } ); |
378 | 379 |
|
|
0 commit comments