Skip to content

Commit

Permalink
Merge pull request #332 from webgme/issue/318_project_navigator
Browse files Browse the repository at this point in the history
Fixes #318 project navigator branch/project updates on delete/create
  • Loading branch information
kecso committed Apr 15, 2015
2 parents f8476e2 + 9bde4a1 commit 20785b2
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/client/js/Panels/Header/ProjectNavigatorController.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ define([
};

ProjectNavigatorController.prototype.update = function () {
if (!this.$scope.$$phase) {
this.$scope.$apply();
}
// force ui update
this.$timeout(function() {

});
};

ProjectNavigatorController.prototype.initialize = function () {
Expand Down Expand Up @@ -485,6 +486,11 @@ define([
redoLastUndoItem,
mergeBranchItem;

if (self.projects.hasOwnProperty(projectId) === false) {
self.logger.warn('project is not in the list yet: ', projectId);
return;
}

if (self.projects[projectId].disabled) {
// do not show any branches if the project is disabled
return;
Expand Down Expand Up @@ -917,11 +923,19 @@ define([
};

ProjectNavigatorController.prototype.updateBranch = function (projectId, branchId, branchInfo) {
this.projects[projectId].branches[branchId].properties = {
hashTag: branchInfo || '#1234567890',
lastCommiter: 'petike',
lastCommitTime: new Date()
};
if (this.projects.hasOwnProperty(projectId) &&
this.projects[projectId].branches.hasOwnProperty(branchId)) {

this.projects[projectId].branches[branchId].properties = {
hashTag: branchInfo || '#1234567890',
lastCommiter: 'petike',
lastCommitTime: new Date()
};

this.update();
} else {
this.logger.warn('project or branch is not in the list yet: ', projectId, branchId, branchInfo);
}
};

ProjectNavigatorController.prototype.mergeBranch = function (projectId, whatBranchId, whereBranchId) {
Expand Down

0 comments on commit 20785b2

Please sign in to comment.