Skip to content

Commit 8a1b4c2

Browse files
Stale offset persists after popup is reused with a lower stack depth
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 2c63572 commit 8a1b4c2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

modules/system/assets/ui/js/popup.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,10 @@
328328
// https://github.com/twbs/bootstrap/issues/15856
329329
this.$dialog.css('transform', 'inherit')
330330

331-
if (stackDepth > 0) {
332-
this.$dialog.css({
333-
top: (stackDepth * Popup.STACK_OFFSET) + 'px',
334-
left: (stackDepth * Popup.STACK_OFFSET) + 'px'
335-
})
336-
}
331+
this.$dialog.css({
332+
top: stackDepth > 0 ? (stackDepth * Popup.STACK_OFFSET) + 'px' : '',
333+
left: stackDepth > 0 ? (stackDepth * Popup.STACK_OFFSET) + 'px' : ''
334+
})
337335
}
338336

339337
Popup.prototype.hide = function() {

0 commit comments

Comments
 (0)