Skip to content

Fix diffview #608

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed changing favorites for users without permissions (#587)
- Fix creating new branch from Git Web UI (#591)
- Fix wording for Git Repo Root Directory (#601)
- Fix Diff View options not applying immediately (#590)

## [2.6.0] - 2024-10-07

Expand Down
19 changes: 15 additions & 4 deletions git-webui/release/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,13 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
var self = this;

self.update = function(cmd, diffOpts, file, mode) {
if (cmd || diffOpts || file || mode) {
// if new input, update all
this.cmd = cmd
this.diffOpts = diffOpts
this.file = file
this.mode = mode
}
gitApplyType = mode;
$(".diff-stage", self.element).attr("style", "display:none");
$(".diff-cancel", self.element).attr("style", "display:none");
Expand Down Expand Up @@ -1576,6 +1583,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
}
};

self.reRun = function() {
self.update(this.cmd, this.diffOpts, this.file, this.mode)
}

self.refresh = function(diff) {
self.currentDiff = diff;
self.diffHeader = "";
Expand Down Expand Up @@ -1789,24 +1800,24 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi

self.addContext = function() {
self.context += 3;
self.update();
self.reRun();
}

self.removeContext = function() {
if (self.context > 3) {
self.context -= 3;
self.update();
self.reRun();
}
}

self.allContext = function() {
self.complete = !self.complete;
self.update();
self.reRun();
}

self.toggleIgnoreWhitespace = function() {
self.ignoreWhitespace = !self.ignoreWhitespace;
self.update();
self.reRun();
}

self.handleClick = function(event) {
Expand Down
19 changes: 15 additions & 4 deletions git-webui/src/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,13 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
var self = this;

self.update = function(cmd, diffOpts, file, mode) {
if (cmd || diffOpts || file || mode) {
// if new input, update all
this.cmd = cmd
this.diffOpts = diffOpts
this.file = file
this.mode = mode
}
gitApplyType = mode;
$(".diff-stage", self.element).attr("style", "display:none");
$(".diff-cancel", self.element).attr("style", "display:none");
Expand Down Expand Up @@ -1576,6 +1583,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
}
};

self.reRun = function() {
self.update(this.cmd, this.diffOpts, this.file, this.mode)
}

self.refresh = function(diff) {
self.currentDiff = diff;
self.diffHeader = "";
Expand Down Expand Up @@ -1789,24 +1800,24 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi

self.addContext = function() {
self.context += 3;
self.update();
self.reRun();
}

self.removeContext = function() {
if (self.context > 3) {
self.context -= 3;
self.update();
self.reRun();
}
}

self.allContext = function() {
self.complete = !self.complete;
self.update();
self.reRun();
}

self.toggleIgnoreWhitespace = function() {
self.ignoreWhitespace = !self.ignoreWhitespace;
self.update();
self.reRun();
}

self.handleClick = function(event) {
Expand Down
Loading