Incorporate feedback from PR review

This commit is contained in:
Sebastian Serth
2019-03-12 13:01:25 +01:00
parent 900bc896c9
commit d63469099b
3 changed files with 91 additions and 90 deletions

View File

@@ -24,7 +24,8 @@ $.fn.scrollTo = function(selector) {
}, ANIMATION_DURATION);
};
$.fn.replaceWithPush = function(a) {
// Same as $.replaceWith, just returns the new element instead of the deleted one
$.fn.replaceWithAndReturnNewElement = function(a) {
const $a = $(a);
this.replaceWith($a);
return $a;

View File

@@ -31,7 +31,7 @@ $(document).on('turbolinks:load', function() {
if ($row.length === 0) {
$row = $($('#posted_rfcs')[0].insertRow(0));
}
$row = $row.replaceWithPush(data.html);
$row = $row.replaceWithAndReturnNewElement(data.html);
$row.find('time').timeago();
$row.click(function () {
Turbolinks.visit($(this).data("href"));
@@ -236,7 +236,7 @@ $(document).on('turbolinks:load', function() {
$('#no_chart_data').addClass("d-none");
transitionStacked();
// transitionGrouped();
// ToDo: Add button to switch using transitionGrouped();
buildDictionary(additional_user_data);
}