@@ -163,7 +163,9 @@ export default class ResultView {
163
163
}
164
164
165
165
// only read from the DOM
166
- decideUpdateWidth ( edRect ) {
166
+ decideUpdateWidth ( edRect , winWidth ) {
167
+ this . edRect = edRect
168
+ this . winWidth = winWidth
167
169
this . isVisible = false
168
170
this . left = 0
169
171
this . shouldRedraw = false
@@ -179,7 +181,7 @@ export default class ResultView {
179
181
}
180
182
181
183
// only write to the DOM
182
- updateWidth ( edRect , winWidth ) {
184
+ updateWidth ( ) {
183
185
if ( ! ! this . isVisible || this . model . expanded ) {
184
186
this . getView ( ) . style . visibility = 'visible'
185
187
this . getView ( ) . style . pointerEvents = 'auto'
@@ -188,16 +190,16 @@ export default class ResultView {
188
190
this . getView ( ) . style . pointerEvents = 'none'
189
191
}
190
192
if ( ! ! this . isVisible && ( this . shouldRedraw || this . modelUpdated ) ) {
191
- let w = edRect . right - RESULT_OFFSET - 10 - this . left
193
+ let w = this . edRect . right - RESULT_OFFSET - 10 - this . left
192
194
if ( w < MIN_RESULT_WIDTH ) w = MIN_RESULT_WIDTH
193
- if ( edRect . width > 0 && this . left + RESULT_OFFSET + w > edRect . right ) {
194
- this . getView ( ) . style . left = ( edRect . right - w - 10 - this . left ) + 'px'
195
+ if ( this . edRect . width > 0 && this . left + RESULT_OFFSET + w > this . edRect . right ) {
196
+ this . getView ( ) . style . left = ( this . edRect . right - w - 10 - this . left ) + 'px'
195
197
this . getView ( ) . style . opacity = 0.75
196
198
} else {
197
199
this . getView ( ) . style . left = RESULT_OFFSET + 'px'
198
200
this . getView ( ) . style . opacity = 1.0
199
201
}
200
- this . getView ( ) . parentElement . style . maxWidth = ( winWidth - RESULT_OFFSET - 10 - this . left ) + 'px'
202
+ this . getView ( ) . parentElement . style . maxWidth = ( this . winWidth - RESULT_OFFSET - 10 - this . left ) + 'px'
201
203
this . getView ( ) . style . maxWidth = w + 'px'
202
204
this . modelUpdated = false
203
205
}
0 commit comments