aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog/new-file-location.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-location.reel')
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html9
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js31
2 files changed, 31 insertions, 9 deletions
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html
index 7340251c..1f9d9b9f 100755
--- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html
@@ -58,13 +58,20 @@
58 } 58 }
59 }, 59 },
60 60
61 "newFileName": {
62 "prototype": "montage/ui/textfield.reel",
63 "properties": {
64 "element": {"#": "newFileName"}
65 }
66 },
67
61 "owner":{ 68 "owner":{
62 "module": "js/io/ui/new-file-dialog/new-file-location.reel", 69 "module": "js/io/ui/new-file-dialog/new-file-location.reel",
63 "name": "NewFileLocation", 70 "name": "NewFileLocation",
64 "properties": { 71 "properties": {
65 "element": {"#": "newfileLocation"}, 72 "element": {"#": "newfileLocation"},
66 "fileInputField": {"@": "fileInputField"}, 73 "fileInputField": {"@": "fileInputField"},
67 "newFileName": {"#": "newFileName"} 74 "newFileName": {"@": "newFileName"}
68 } 75 }
69 } 76 }
70 } 77 }
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
index 0e1e09a4..3ac38d02 100755
--- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
@@ -22,19 +22,34 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
22 value: function() { 22 value: function() {
23 this.fileInputField.selectDirectory = true; 23 this.fileInputField.selectDirectory = true;
24 24
25 this.newFileName.addEventListener("keyup", this, false); 25 this.addEventListener("change@newFileName.value", this.newFileNameChange, false);
26 this.newFileName.element.addEventListener("keyup", this, false);
27 this.newFileName.element.focus();
28 this.newFileName.element.select();
26 } 29 }
27 }, 30 },
28 31
29 handleKeyup:{ 32 handleKeyup:{
30 value:function(evt){ 33 value: function(evt){
31 if(this.newFileName.value !== "") { 34 if(evt.keyCode === 13){
32 var newFileNameSetEvent = document.createEvent("Events"); 35 var enterKeyupEvent = document.createEvent("Events");
33 newFileNameSetEvent.initEvent("newFileNameSet", false, false); 36 enterKeyupEvent.initEvent("enterKey", false, false);
34 newFileNameSetEvent.newFileName = this.newFileName.value; 37 this.eventManager.dispatchEvent(enterKeyupEvent);
35 this.eventManager.dispatchEvent(newFileNameSetEvent); 38 }else if(evt.keyCode === 27){
39 var escKeyupEvent = document.createEvent("Events");
40 escKeyupEvent.initEvent("escKey", false, false);
41 this.eventManager.dispatchEvent(escKeyupEvent);
36 } 42 }
37 } 43 }
38 } 44 },
39 45
46 newFileNameChange:{
47 value:function(evt){
48 var newFileNameSetEvent = document.createEvent("Events");
49 newFileNameSetEvent.initEvent("newFileNameSet", false, false);
50 newFileNameSetEvent.newFileName = this.newFileName.value;
51 newFileNameSetEvent.keyCode = evt.keyCode;
52 this.eventManager.dispatchEvent(newFileNameSetEvent);
53 }
54 }
40}); \ No newline at end of file 55}); \ No newline at end of file