Clean up the RB.TextCommentRowSelector
Review Request #10192 — Created Oct. 4, 2018 and submitted
The
RB.TextCommentRowSelectorhas been cleaned up, modernized, and
ported to ES6. All the method documentation is now aligned with our
documentation standards.There were two cases of event handlers (for
mousedownandmouseup)
which were sometimes returningFalseto prevent the default event
from ocurring. However, this behaviour is not actually supported; the
DOM events formousedownandmouseupdo not havepreventDefaultin
their prototypes and so the default behaviour cannot be prevented.The
_copySelectionToClipboardhas been modernized to not do repeated
string concatentation. Instead it builds up an array of strings and
joins them with the detected platform's newline character.In addition, a function that
_copySelectionToClipboardwas defining
has been pulled out into the prototype to make it clear that it does not
close over any variables in the method.
Ran JS tests.
- Description:
-
The
RB.TextCommentRowSelectorhas been cleaned up, modernized, andported to ES6. All the method documentation is now aligned with our documentation standards. There were two cases of event handlers (for
mousedownandmouseup)which were sometimes returning Falseto prevent the default eventfrom ocurring. However, this behaviour is not actually supported; the DOM events for mousedownandmouseupdo not havepreventDefaultintheir prototypes and so the default behaviour cannot be prevented. + + The
_copySelectionToClipboardhas been modernized to not do repeated+ string concatentation. Instead it builds up an array of strings and + joins them with the detected platform's newline character. + + In addition, a function that
_copySelectionToClipboardwas defining+ has been pulled out into the prototype to make it clear that it does not + close over any variables in the method. - Commit:
-
344094cd4acb9ff9fdd159669bcfa15f2d3a61bdb5eb5819b482eeda4fb3b2fa97ccdbb3efa509c7
Checks run (2 succeeded)
- Commit:
-
b5eb5819b482eeda4fb3b2fa97ccdbb3efa509c7b02625207be89a029f6b582c72c28919e73ba9c2
Checks run (2 succeeded)
- Change Summary:
-
Addressed feedback.
- Commit:
-
b02625207be89a029f6b582c72c28919e73ba9c2ebd3e6a006e5070cc05c8f6d37b88ff6b8419815