File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 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) {
233233
234234// resize plot about the container size
235235plots . resize = function ( gd ) {
236- if ( ! gd || d3 . select ( gd ) . style ( 'display' ) === 'none' ) return ;
236+ if ( ! gd || d3 . select ( gd ) . style ( 'display' ) === 'none' ) return ;
237237
238- if ( gd . _redrawTimer ) clearTimeout ( gd . _redrawTimer ) ;
238+ return new Promise ( function ( resolve ) {
239239
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 ) ;
244241
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 ;
247246
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+ } ) ;
252256} ;
253257
254258
You can’t perform that action at this time.
0 commit comments