-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix Rich-Text Cross-Wiring in Comment Forms #9011
Fix Rich-Text Cross-Wiring in Comment Forms #9011
Conversation
Code Climate has analyzed commit ef0ab12 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## main #9011 +/- ##
=======================================
Coverage ? 82.03%
=======================================
Files ? 100
Lines ? 5933
Branches ? 0
=======================================
Hits ? 4867
Misses ? 1066
Partials ? 0 |
$E[action](); // call the appropriate editor function | ||
}); | ||
}); | ||
|
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 have doubts about if this is the right place to put this click eventHandler.
@@ -32,20 +32,10 @@ jQuery(function() { | |||
$('#side-dropzone').removeClass('hover'); | |||
}); | |||
$('.dropzone').on('drop',function(e) { | |||
// this 'drop' listener is also reused for pages with just one form, ie. /wiki/new | |||
const closestCommentFormWrapper = e.target.closest('div.comment-form-wrapper'); // this returns null if there is no match | |||
const params = getEditorParams(e.target); // defined in editorHelper.js | |||
e.preventDefault(); |
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.
Am I doing this right: calling on editorHelper.js? I browsed the Rails guide to JS assets, but am not sure if what I'm doing falls under 'best practices'. Would appreciate some pointers if you have any.
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.
Yes that looks fine to me
@jywarren Had some questions about requiring JS files in Rails, and where to put a click eventHandler. Other than that, this is ready to merge! |
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.
🎉
@@ -32,20 +32,10 @@ jQuery(function() { | |||
$('#side-dropzone').removeClass('hover'); | |||
}); | |||
$('.dropzone').on('drop',function(e) { | |||
// this 'drop' listener is also reused for pages with just one form, ie. /wiki/new | |||
const closestCommentFormWrapper = e.target.closest('div.comment-form-wrapper'); // this returns null if there is no match | |||
const params = getEditorParams(e.target); // defined in editorHelper.js | |||
e.preventDefault(); |
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.
Yes that looks fine to me
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.
Fantastic 🎉
* add rich-text tests publiclab#8478 * fix indentation publiclab#8478 * delete onclick for rich-text buttons; add data-action attribute publiclab#8478 * add click handler for rich-text buttons publiclab#8478 * extract code to editorHelper for DRY publiclab#8478 * require editorHelper.js publiclab#8478 * change == to === publiclab#8478
* add rich-text tests publiclab#8478 * fix indentation publiclab#8478 * delete onclick for rich-text buttons; add data-action attribute publiclab#8478 * add click handler for rich-text buttons publiclab#8478 * extract code to editorHelper for DRY publiclab#8478 * require editorHelper.js publiclab#8478 * change == to === publiclab#8478
* add rich-text tests publiclab#8478 * fix indentation publiclab#8478 * delete onclick for rich-text buttons; add data-action attribute publiclab#8478 * add click handler for rich-text buttons publiclab#8478 * extract code to editorHelper for DRY publiclab#8478 * require editorHelper.js publiclab#8478 * change == to === publiclab#8478
* add rich-text tests publiclab#8478 * fix indentation publiclab#8478 * delete onclick for rich-text buttons; add data-action attribute publiclab#8478 * add click handler for rich-text buttons publiclab#8478 * extract code to editorHelper for DRY publiclab#8478 * require editorHelper.js publiclab#8478 * change == to === publiclab#8478
Fixes #8478
This PR is a duplicate of #9003, which is now closed (I did a
git rebase main
in the other branch, which was bundling changes frommain
into the PR. Couldn't figure out how to undo that).From the other PR write-up:
(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)