aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalgorzata Janczarska2011-05-26 07:22:51 (EDT)
committerMalgorzata Janczarska2011-05-26 07:22:51 (EDT)
commitdda4eff0db98b82f8620761b34f63141e823c323 (patch)
tree50f32f67ddae42d7f9e7313a8f9bd1ccd4a4a07a
parent3ec97b1da80d89951dcaef27d3905acf6794055f (diff)
downloadorg.eclipse.orion.client-dda4eff0db98b82f8620761b34f63141e823c323.zip
org.eclipse.orion.client-dda4eff0db98b82f8620761b34f63141e823c323.tar.gz
org.eclipse.orion.client-dda4eff0db98b82f8620761b34f63141e823c323.tar.bz2
Bug 346975 - [client] Use dojo dialogs instead prompts - Create Branch
-rw-r--r--bundles/org.eclipse.orion.client.git/static/js/gitCommands.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js b/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js
index 2b4aa68..eac4253 100644
--- a/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js
@@ -258,14 +258,22 @@ dojo.require("widgets.GitCredentialsDialog");
image: "/images/add_obj.gif",
id: "eclipse.addBranch",
callback: function(item) {
- var branchName = prompt("Enter branch name");
- serviceRegistry.getService("orion.git.provider").then(
- function(service) {
- service.addBranch(item.Location, branchName).then(function(){
- dojo.hitch(explorer, explorer.changedItem)(item);
- });
- }
- );
+ var dialog = new widgets.NewItemDialog({
+ title: "Add Branch",
+ label: "Branch name:",
+ func: function(name, url, create){
+ serviceRegistry.getService("orion.git.provider").then(
+ function(service) {
+ service.addBranch(item.Location, name).then(function(){
+ dojo.hitch(explorer, explorer.changedItem)(item);
+ });
+ }
+ );
+ },
+ advanced: false
+ });
+ dialog.startup();
+ dialog.show();
},
visibleWhen: function(item) {
return item.GroupNode && item.Name === "Branch";