-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
WYSIWYG-Editor Insert Image-Popup is not working correctly with multiple WYSIWYG-Editors on page #25556
Conversation
Hi @engcom-Golf. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, please take a look at my review comments
wUrl = this.config['files_browser_window_url'] + | ||
'target_element_id/' + this.getId() + '/' + | ||
'store/' + storeId + '/'; | ||
|
||
this.initialize(this.getId(), this.config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will call initialize
3 times, it's a very strange approach, why we need to do it?
lib/web/mage/adminhtml/browser.js
Outdated
) { | ||
if (typeof options.closed !== 'undefined') { | ||
this.modal.modal('option', 'closed', options.closed); | ||
} | ||
this.modal.modal('openModal'); | ||
|
||
return; | ||
} else if (typeof options === 'undefined' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check to undefined it isn't the best solution. You can check just like if (options)
or in case if you really need to check to undefined ( maybe in some cases it's really needed ) we should use _.isUndefined method from underscore library because typeof
has some side effects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Hi @VladimirZaets, thank you for the review.
|
@engcom-Golf thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at my review comment
lib/web/mage/adminhtml/browser.js
Outdated
) { | ||
if (typeof options.closed !== 'undefined') { | ||
this.modal.modal('option', 'closed', options.closed); | ||
} | ||
this.modal.modal('openModal'); | ||
|
||
return; | ||
} else if (_.isUndefined(options) && self.modalLoaded === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can combine inner if with (_.isUndefined(options) && self.modalLoaded === true)
Hi @VladimirZaets, thank you for the review. |
✔️ QA Passed |
Hi @sivaschenko, thank you for the review. |
…ly with multiple WYSIWYG-Editors on page #25556
Hi @engcom-Golf, thank you for your contribution! |
Description (*)
Reworked version for #23966
Fixed Issues (if relevant)
2.WYSIWYG-Editor Insert Image-Popup is not working correctly with multiple WYSIWYG-Editors on page #18548 WYSIWYG-Editor Insert Image-Popup is not working correctly with multiple WYSIWYG-Editors on page
Manual testing scenarios (*)
[case 1]
[case 2]
Questions or comments
Contribution checklist (*)