Skip to content

Commit a6a09d3

Browse files
Survey: Highlight the question that was just updated and scroll down to it (scrollIntoView())
1 parent 08f5afb commit a6a09d3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

main/survey/survey.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,19 @@
308308
}
309309
}
310310

311-
echo '<tr class="'.$questionsGroupClass.$breakClass.'">';
311+
// Highlight the question that was just updated and scrool to it
312+
if ($row['question_id']==$my_question_id_survey) {
313+
echo '<tr class="'.$questionsGroupClass.$breakClass.'" style="background-color:#A9DFBF;" >';
314+
echo '<a name="tocupdatelink" id="tocupdatelink" ></a>';
315+
echo '<script>';
316+
echo '$(document).ready(function() {';
317+
echo "var element_to_scroll_to = document.getElementById('tocupdatelink');";
318+
echo 'element_to_scroll_to.scrollIntoView();';
319+
echo '});';
320+
echo '</script>';
321+
} else {
322+
echo '<tr class="'.$questionsGroupClass.$breakClass.'">';
323+
}
312324
echo ' <td>'.$question_counter.'</td>';
313325
echo ' <td>';
314326

0 commit comments

Comments
 (0)