summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMike Rennie2013-11-05 10:12:45 (EST)
committer Mike Rennie2013-11-05 10:12:45 (EST)
commitca9e3f5c335d09b5a833043023a02b6beb3bbdbb (patch)
tree3cff74f477cb7e60bceeb4e449b38c60dbc2ae57
parent385bb48c3021cb84aab2c28965f36facde866e5b (diff)
downloadorg.eclipse.orion.client-ca9e3f5c335d09b5a833043023a02b6beb3bbdbb.zip
org.eclipse.orion.client-ca9e3f5c335d09b5a833043023a02b6beb3bbdbb.tar.gz
org.eclipse.orion.client-ca9e3f5c335d09b5a833043023a02b6beb3bbdbb.tar.bz2
Bug 420009 - Sort the repositories pagev20131105-1512refs/changes/86/18086/1
Change-Id: I0e3a30a32a60c342edb18ca9aa51e8de90aa3887 Signed-off-by: Mike Rennie <Michael_Rennie@ca.ibm.com>
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js
index 66c748d..c47c765 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js
@@ -362,10 +362,26 @@ exports.GitRepositoryExplorer = (function() {
return deferred;
};
+ /**
+ * @name _repositorySorter
+ * @description Simple function to sort repositories by name
+ * @function
+ * @private
+ * @memberof GitRepositoryExplorer.prototype
+ * @param {Object} The repository to compare to
+ * @param {Object} The repository to compare
+ * @since 5.0
+ */
+ GitRepositoryExplorer.prototype._repositorySorter = function(repo1, repo2) {
+ return repo1.Name.localeCompare(repo2.Name);
+ };
+
GitRepositoryExplorer.prototype.displayRepositories = function(repositories, mode, links){
var that = this;
var progressService = this.registry.getService("orion.page.message"); //$NON-NLS-0$
-
+ if(repositories) {
+ repositories.sort(that._repositorySorter);
+ }
var dynamicContentModel = new mDynamicContent.DynamicContentModel(repositories,
function(i){
return that.decorateRepository.bind(that)(repositories[i]);