@@ -45,6 +45,7 @@ qx.Class.define("qxapp.component.widget.PersistentIframe", {
45
45
} ,
46
46
members : {
47
47
__iframe : null ,
48
+ __syncScheduled : null ,
48
49
__actionButton : null ,
49
50
// override
50
51
_createContentElement : function ( ) {
@@ -96,11 +97,11 @@ qx.Class.define("qxapp.component.widget.PersistentIframe", {
96
97
} ) ;
97
98
this . addListener ( "move" , e => {
98
99
// got to let the new layout render first or we don't see it
99
- qx . event . Timer . once ( this . __syncIframePos , this , 0 ) ;
100
+ this . __syncIframePos ( ) ;
100
101
} ) ;
101
102
this . addListener ( "resize" , e => {
102
103
// got to let the new layout render first or we don't see it
103
- qx . event . Timer . once ( this . __syncIframePos , this , 0 ) ;
104
+ this . __syncIframePos ( ) ;
104
105
} ) ;
105
106
this . addListener ( "changeVisibility" , e => {
106
107
var visibility = e . getData ( ) [ 0 ] ;
@@ -115,21 +116,28 @@ qx.Class.define("qxapp.component.widget.PersistentIframe", {
115
116
return standin ;
116
117
} ,
117
118
__syncIframePos : function ( ) {
118
- let iframeParentPos = qx . bom . element . Location . get ( qx . bom . element . Location . getOffsetParent ( this . __iframe . getContentElement ( ) . getDomElement ( ) ) , "scroll" ) ;
119
- let divPos = qx . bom . element . Location . get ( this . getContentElement ( ) . getDomElement ( ) , "scroll" ) ;
120
- let divSize = qx . bom . element . Dimension . getSize ( this . getContentElement ( ) . getDomElement ( ) ) ;
121
- this . __iframe . setLayoutProperties ( {
122
- top : divPos . top - iframeParentPos . top ,
123
- left : ( divPos . left - iframeParentPos . left )
124
- } ) ;
125
- this . __iframe . set ( {
126
- width : ( divSize . width ) ,
127
- height : ( divSize . height )
128
- } ) ;
129
- this . __actionButton . setLayoutProperties ( {
130
- top : ( divPos . top - iframeParentPos . top ) ,
131
- right : ( iframeParentPos . right - iframeParentPos . left - divPos . right )
132
- } ) ;
119
+ if ( this . __syncScheduled ) {
120
+ return ;
121
+ }
122
+ this . __syncScheduled = true ;
123
+ window . setTimeout ( ( ) => {
124
+ this . __syncScheduled = false ;
125
+ let iframeParentPos = qx . bom . element . Location . get ( qx . bom . element . Location . getOffsetParent ( this . __iframe . getContentElement ( ) . getDomElement ( ) ) , "scroll" ) ;
126
+ let divPos = qx . bom . element . Location . get ( this . getContentElement ( ) . getDomElement ( ) , "scroll" ) ;
127
+ let divSize = qx . bom . element . Dimension . getSize ( this . getContentElement ( ) . getDomElement ( ) ) ;
128
+ this . __iframe . setLayoutProperties ( {
129
+ top : divPos . top - iframeParentPos . top ,
130
+ left : ( divPos . left - iframeParentPos . left )
131
+ } ) ;
132
+ this . __iframe . set ( {
133
+ width : ( divSize . width ) ,
134
+ height : ( divSize . height )
135
+ } ) ;
136
+ this . __actionButton . setLayoutProperties ( {
137
+ top : ( divPos . top - iframeParentPos . top ) ,
138
+ right : ( iframeParentPos . right - iframeParentPos . left - divPos . right )
139
+ } ) ;
140
+ } , 0 ) ;
133
141
} ,
134
142
_applyShowMaximize : function ( newValue , oldValue ) {
135
143
this . _maximizeBtn . show ( ) ;
0 commit comments