-
-
Notifications
You must be signed in to change notification settings - Fork 227
Relation controller popup: fix size, add cssClass and allowDismiss #1044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
5708357
72c6238
b078572
21edb7f
bde98dd
4ec18a0
fc77e5b
137b717
c296dbe
55701c2
3a1511a
f4bf2ec
929c822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,9 @@ | |
| content: null, | ||
| size: null, | ||
| adaptiveHeight: false, | ||
| zIndex: null | ||
| zIndex: null, | ||
| cssClass: null, | ||
| allowDismiss: false | ||
| } | ||
|
|
||
| Popup.prototype.init = function(){ | ||
|
|
@@ -207,8 +209,22 @@ | |
| if (this.options.adaptiveHeight) | ||
| modalDialog.addClass('adaptive-height') | ||
|
|
||
| if (this.options.cssClass) | ||
| modalDialog.addClass(this.options.cssClass) | ||
|
|
||
| if (this.options.zIndex !== null) | ||
| modal.css('z-index', this.options.zIndex + 20) | ||
|
|
||
| if (this.options.allowDismiss) { | ||
| modal.on('mousedown', function(e) { | ||
| const target = e.target; | ||
| if (target.classList.contains('control-popup')) { | ||
| modal.hide() | ||
| $('.popup-backdrop').remove() | ||
| $(document.body).removeClass('modal-open') | ||
| } | ||
| }); | ||
| } | ||
|
Comment on lines
+218
to
+227
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: allowDismiss implementation bypasses popup lifecycle and lock mechanism. The current implementation has several critical flaws:
Recommendation: Based on the PR discussion where LukeTowers requested removing allowDismiss until safer handling is implemented, consider either:
🔧 Proposed fix to use proper popup hide method if (this.options.allowDismiss) {
+ var self = this
modal.on('mousedown', function(e) {
const target = e.target;
if (target.classList.contains('control-popup')) {
- modal.hide()
- $('.popup-backdrop').remove()
- $(document.body).removeClass('modal-open')
+ // Use the popup instance's hide method to ensure proper cleanup
+ self.hide()
}
});
}Note: This fix addresses the lifecycle bypass but does not solve the missing change monitoring concern. 🤖 Prompt for AI Agents |
||
|
|
||
| return modal.append(modalDialog.append(modalContent)) | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.