Skip to content

Commit

Permalink
ASTDiff GUI: Fix the scrolling issues
Browse files Browse the repository at this point in the history
Further fix for tsantalis#672
  • Loading branch information
pouryafard75 committed Aug 23, 2024
1 parent ef343a6 commit 26d0a4b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void renderOn(HtmlCanvas html) {
._div()
._div()
.div(id("collapse-" + i).class_("collapse show").add("aria-labelledby", "heading-" + i))
.div(class_("card-body").style("padding: 0;"));
.div(class_("card-body").style("overflow: hidden; padding: 0;"));
makeEachDiff(html, i, core);
html
._div()
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/web/dist/monaco.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ div {
}

#diff_panel {
overflow-y: auto;
height: 100%;
}
/*.deleted {*/
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/web/dist/monaco.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function getEditorOptions(config, text) {
lineDecorationsWidth: 0,
glyphMargin: false,
scrollbar: {
alwaysConsumeMouseWheel: false
alwaysConsumeMouseWheel: false,
vertical: config.spv === true ? 'hidden' : 'auto'
},
minimap: {
enabled: false,
Expand Down
11 changes: 9 additions & 2 deletions src/main/resources/web/dist/single.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
.monaco-panel {
overflow-y: auto; /* Enable scrollbar for Monaco panel */
overflow: hidden; /* Disable both vertical and horizontal scrollbars */

height: 100%; /* Ensure it fills the available height */
}
.dir-diff{
height: 100%;
overflow-y: scroll; /* Enable vertical scrolling */
overflow-x: hidden; /* Disable horizontal scrolling */
}

#accordion {
overflow-y: auto; /* Enable scrollbar for accordion */
overflow-y: scroll; /* Enable vertical scrolling */
overflow-x: hidden; /* Disable horizontal scrolling */
height: 100%; /* Ensure it fills the available height */
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/web/dist/single.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
x = 1;
$(document).ready(function() {
// Select all elements with an ID that starts with 'diff_row_'
$('[id^="diff_row_"]').each(function() {
Expand All @@ -11,7 +10,6 @@ $(document).ready(function() {
event.preventDefault(); // Prevent the default anchor behavior
var targetId = 'heading-' + id.split('_')[2];
var $target = $('#' + targetId);
x = $target
var targetOffset = $('#' + targetId).offset().top;
var accordionOffset = $('#accordion').offset().top;
var scrollTo = targetOffset - accordionOffset + $('#accordion').scrollTop();
Expand Down

0 comments on commit 26d0a4b

Please sign in to comment.