File tree 3 files changed +10
-6
lines changed
3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,19 @@ export default function() {
20
20
widgetsRendering ++ ;
21
21
} ) ;
22
22
23
- apos . bus . $on ( 'widget-rendered' , function ( ) {
23
+ apos . bus . $on ( 'widget-rendered' , options => {
24
24
widgetsRendering -- ;
25
- createAreaAppsAndRunPlayersIfDone ( ) ;
25
+ createAreaAppsAndRunPlayersIfDone ( options ) ;
26
26
} ) ;
27
27
28
28
apos . bus . $on ( 'refreshed' , function ( ) {
29
29
createAreaAppsAndRunPlayersIfDone ( ) ;
30
30
} ) ;
31
31
32
- function createAreaAppsAndRunPlayersIfDone ( ) {
33
- createAreaApps ( ) ;
32
+ function createAreaAppsAndRunPlayersIfDone ( { edit = true } = { } ) {
33
+ if ( edit ) {
34
+ createAreaApps ( ) ;
35
+ }
34
36
if ( widgetsRendering === 0 ) {
35
37
apos . util . runPlayers ( ) ;
36
38
}
Original file line number Diff line number Diff line change @@ -338,7 +338,9 @@ function guessOrigin(area) {
338
338
// side of the screen will least obscure the widget
339
339
const rect = area .$el .getBoundingClientRect ();
340
340
const cx = (rect .right - rect .left ) / 2 + rect .left ;
341
- if (cx >= (window .innerWidth / 2 )) {
341
+ // Favor the right hand side slightly because rich text
342
+ // subwidgets in centered areas are more intuitive that way
343
+ if (cx >= (window .innerWidth * 0.55 )) {
342
344
return ' left' ;
343
345
} else {
344
346
return ' right' ;
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export default {
83
83
// in the DOM before hinting that it might be time to prepare
84
84
// sub-area editors and run players
85
85
setTimeout ( function ( ) {
86
- apos . bus . $emit ( 'widget-rendered' ) ;
86
+ apos . bus . $emit ( 'widget-rendered' , { edit : ! aposLivePreview } ) ;
87
87
} , 0 ) ;
88
88
} catch ( e ) {
89
89
this . rendered = '<p>Unable to render this widget.</p>' ;
You can’t perform that action at this time.
0 commit comments