File tree 1 file changed +16
-12
lines changed
1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -233,22 +233,26 @@ plots.redrawText = function(gd) {
233
233
234
234
// resize plot about the container size
235
235
plots . resize = function ( gd ) {
236
- if ( ! gd || d3 . select ( gd ) . style ( 'display' ) === 'none' ) return ;
236
+ if ( ! gd || d3 . select ( gd ) . style ( 'display' ) === 'none' ) return ;
237
237
238
- if ( gd . _redrawTimer ) clearTimeout ( gd . _redrawTimer ) ;
238
+ return new Promise ( function ( resolve ) {
239
239
240
- gd . _redrawTimer = setTimeout ( function ( ) {
241
- if ( ( gd . _fullLayout || { } ) . autosize ) {
242
- // autosizing doesn't count as a change that needs saving
243
- var oldchanged = gd . changed ;
240
+ if ( gd . _redrawTimer ) clearTimeout ( gd . _redrawTimer ) ;
244
241
245
- // nor should it be included in the undo queue
246
- gd . autoplay = true ;
242
+ gd . _redrawTimer = setTimeout ( function ( ) {
243
+ if ( ( gd . _fullLayout || { } ) . autosize ) {
244
+ // autosizing doesn't count as a change that needs saving
245
+ var oldchanged = gd . changed ;
247
246
248
- Plotly . relayout ( gd , { autosize : true } ) ;
249
- gd . changed = oldchanged ;
250
- }
251
- } , 100 ) ;
247
+ // nor should it be included in the undo queue
248
+ gd . autoplay = true ;
249
+
250
+ Plotly . relayout ( gd , { autosize : true } ) ;
251
+ gd . changed = oldchanged ;
252
+ resolve ( ) ;
253
+ }
254
+ } , 100 ) ;
255
+ } ) ;
252
256
} ;
253
257
254
258
You can’t perform that action at this time.
0 commit comments