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
Fixing Double-click of image in Media Browser goes to blank page #14076
Conversation
I've tested this PR and it works as described. |
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.
Can the unreachable code be removed?
I really don’t know where it was used, so yes. |
@@ -1117,6 +1117,7 @@ Ext.extend(MODx.Media, Ext.Container, { | |||
} | |||
|
|||
,onSelect: function(data) { | |||
return false; | |||
// @todo make sure this is never used | |||
console.log('MODx.Media#onSelect', data); |
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.
I guess console.log call should be definitely removed.
I have removed all not needed 'make sure this is never used' code and the logging in those methods. The only part where a double click in the media browser leads to an action still works (doubleclick a file during editing a file selecting template variable or a file insert in the RTE). I did not find another place where the double click is used. |
Works as expected. Tested in latest versions of firefox/chrome/safari and edge. |
What does it do?
Make sure that MODx.Media.onSelect code is not executed by removing the code.
Why is it needed?
MODx.Media.onSelect has hidden
this.config.animEl || null
before, which means that MODx.Media is hidden accidentally. That way a double-click of an image in the Media Browser goes to blank page.Related issue(s)/PR(s)
#14075