aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Luong2013-06-04 02:32:08 (EDT)
committerMark Macdonald2013-06-06 15:50:19 (EDT)
commit858e646386909802eaa6c9bb05b7c768122645d6 (patch)
tree3e266bb9d7184e47f9e9b98f1b70bd4e857a8d5c
parent313c6f538f2961d5e936f5b4b773833f6c39ba5a (diff)
downloadorg.eclipse.orion.client-858e646386909802eaa6c9bb05b7c768122645d6.zip
org.eclipse.orion.client-858e646386909802eaa6c9bb05b7c768122645d6.tar.gz
org.eclipse.orion.client-858e646386909802eaa6c9bb05b7c768122645d6.tar.bz2
Bug 409803 - Commit command buttons are rendered multiple times if files are staged in rapid succession
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js
index 3be5793..3831b56 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js
@@ -755,7 +755,7 @@ define(
function(resp) {
var branches = resp.Children;
var currentBranch;
- for ( var i = 0; i < branches.length; i++) {
+ for (var i = 0; i < branches.length; i++) {
if (branches[i].Current) {
currentBranch = branches[i];
break;
@@ -770,7 +770,7 @@ define(
var tracksRemoteBranch = (currentBranch.RemoteLocation.length === 1 && currentBranch.RemoteLocation[0].Children.length === 1);
titleWrapper.setTitle(i18nUtil.formatMessage(messages["Commits for \"${0}\" branch"], currentBranch.Name));
-
+ that.commandService.destroy(titleWrapper.actionsNode.id);
that.commandService.registerCommandContribution(titleWrapper.actionsNode.id,
"eclipse.orion.git.repositories.viewAllCommand", 10); //$NON-NLS-0$
that.commandService
@@ -778,8 +778,11 @@ define(
titleWrapper.actionsNode.id,
titleWrapper.actionsNode.id,
{
- "ViewAllLink" : "git/git-log.html#" + currentBranch.CommitLocation + "?page=1", "ViewAllLabel" : messages['See Full Log'], "ViewAllTooltip" : messages["See the full log"]}, that, "button"); //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
-
+ "ViewAllLink" : "git/git-log.html#" + currentBranch.CommitLocation + "?page=1",
+ "ViewAllLabel" : messages['See Full Log'],
+ "ViewAllTooltip" : messages["See the full log"]
+ }, that, "button"); //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+
if (tracksRemoteBranch) {
that.commandService.registerCommandContribution(titleWrapper.actionsNode.id, "eclipse.orion.git.fetch", 100); //$NON-NLS-0$
that.commandService.registerCommandContribution(titleWrapper.actionsNode.id, "eclipse.orion.git.merge", 100); //$NON-NLS-0$
@@ -863,17 +866,15 @@ define(
};
GitStatusExplorer.prototype.renderNoCommit = function() {
+ var commitNode = lib.node("commitNode");
+ commitNode.innerHTML = "";
var sectionItem = document.createElement("div");
sectionItem.className = "sectionTableItem";
- lib.node("commitNode").appendChild(sectionItem);
-
- var horizontalBox = document.createElement("div");
- horizontalBox.className = "sectionTableItem";
- sectionItem.appendChild(horizontalBox);
+ commitNode.appendChild(sectionItem);
var detailsView = document.createElement("div");
detailsView.className = "stretch";
- horizontalBox.appendChild(detailsView);
+ sectionItem.appendChild(detailsView);
var title = document.createElement("div");
title.appendChild(document.createTextNode(messages['The branch is up to date.']));
@@ -885,9 +886,11 @@ define(
};
GitStatusExplorer.prototype.renderCommit = function(commit, outgoing, index) {
+ var commitNode = lib.node("commitNode");
+ commitNode.innerHTML = "";
var sectionItem = document.createElement("div");
sectionItem.className = "sectionTableItem lightTreeTableRow";
- lib.node("commitNode").appendChild(sectionItem);
+ commitNode.appendChild(sectionItem);
var horizontalBox = document.createElement("div");
horizontalBox.className = "sectionTableItem";