Fix up the formatting of the repository form JS
Review Request #7761 — Created Nov. 9, 2015 and submitted
This patch brings
repositoryform.js
into line with our style
guidelines.
Verified that the repository form still worked.
Ran JSHint.
Description | From | Last Updated |
---|---|---|
This would be better written if we flip it: $('<p class="help" />') .text(text) .appendTo($('#row-' + field)); |
david | |
Please undo the indentation change here (we want the ? and : to align within the parens) |
david | |
This can be: $hostingAccountPassRow.setVisible(hostingInfo.needs_authorization); |
david | |
This is awkward. Can we store $hostingAccount[0].selectedIndex] into a variable first? We should probably also call this $selectedOption since it's … |
david | |
setVisible() |
david | |
setVisible() |
david | |
Let's wrap $(this) once. |
david | |
Please undo this indentation change. |
david | |
This can use setVisible. |
david | |
setVisible |
david | |
Probably better as $hostingType.val() |
david | |
Probably better as $hostingType.val() |
david | |
Probably better as $bugTrackerType.val() |
david |
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/repositoryform.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/repositoryform.js
-
-
reviewboard/static/rb/js/repositoryform.js (Diff revision 2) This would be better written if we flip it:
$('<p class="help" />') .text(text) .appendTo($('#row-' + field));
-
reviewboard/static/rb/js/repositoryform.js (Diff revision 2) Please undo the indentation change here (we want the ? and : to align within the parens)
-
reviewboard/static/rb/js/repositoryform.js (Diff revision 2) This can be:
$hostingAccountPassRow.setVisible(hostingInfo.needs_authorization);
-
reviewboard/static/rb/js/repositoryform.js (Diff revision 2) This is awkward. Can we store
$hostingAccount[0].selectedIndex]
into a variable first?We should probably also call this
$selectedOption
since it's ajQuery
-
-
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/repositoryform.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/repositoryform.js
-
Found some more stuff. My word this code is old and crusty.
-
-
-
-
-
-
-
reviewboard/static/rb/js/repositoryform.js (Diff revision 3) Probably better as
$bugTrackerType.val()
Change Summary:
Address David's issues & use $.fn.prop() over $.fn.attr()
Diff: |
Revision 4 (+194 -193) |
---|