From 08738146f933337a67ddb7ae34e36880472b05e2 Mon Sep 17 00:00:00 2001 From: Sarmishta Velury Date: Wed, 1 Dec 2021 11:48:30 -0500 Subject: [PATCH] compatibility fix for IE minor bugfix --- .../release/share/git-webui/webui/js/git-webui.js | 11 +++++++++-- git-webui/src/share/git-webui/webui/js/git-webui.js | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/git-webui/release/share/git-webui/webui/js/git-webui.js b/git-webui/release/share/git-webui/webui/js/git-webui.js index 25ab4ca0..af765bfc 100644 --- a/git-webui/release/share/git-webui/webui/js/git-webui.js +++ b/git-webui/release/share/git-webui/webui/js/git-webui.js @@ -1733,12 +1733,18 @@ webui.ChangedFilesView = function(workspaceView, type, label) { }); } - self.getFileList = function(including, excluding, onlyUnavailable=0, stringifyFilenames = 1) { - if(stringifyFilenames) + self.getFileList = function(including, excluding, onlyUnavailable, stringifyFilenames) { + if(stringifyFilenames || stringifyFilenames == undefined){ + stringifyFilenames = 1 var files = ""; + } else var files = []; + if(onlyUnavailable == undefined){ + onlyUnavailable = 0 + } + for (var i = 0; i < fileList.childElementCount; ++i) { var child = fileList.children[i]; var included = including == undefined || including.indexOf(child.status) != -1; @@ -1792,6 +1798,7 @@ webui.ChangedFilesView = function(workspaceView, type, label) { self.cancelByAvailability = function() { prevScrollTop = fileListContainer.scrollTop; + self.cancel(); var action = "discard" var files = self.getFileList(undefined, undefined, 1, 0); diff --git a/git-webui/src/share/git-webui/webui/js/git-webui.js b/git-webui/src/share/git-webui/webui/js/git-webui.js index 25ab4ca0..af765bfc 100644 --- a/git-webui/src/share/git-webui/webui/js/git-webui.js +++ b/git-webui/src/share/git-webui/webui/js/git-webui.js @@ -1733,12 +1733,18 @@ webui.ChangedFilesView = function(workspaceView, type, label) { }); } - self.getFileList = function(including, excluding, onlyUnavailable=0, stringifyFilenames = 1) { - if(stringifyFilenames) + self.getFileList = function(including, excluding, onlyUnavailable, stringifyFilenames) { + if(stringifyFilenames || stringifyFilenames == undefined){ + stringifyFilenames = 1 var files = ""; + } else var files = []; + if(onlyUnavailable == undefined){ + onlyUnavailable = 0 + } + for (var i = 0; i < fileList.childElementCount; ++i) { var child = fileList.children[i]; var included = including == undefined || including.indexOf(child.status) != -1; @@ -1792,6 +1798,7 @@ webui.ChangedFilesView = function(workspaceView, type, label) { self.cancelByAvailability = function() { prevScrollTop = fileListContainer.scrollTop; + self.cancel(); var action = "discard" var files = self.getFileList(undefined, undefined, 1, 0);