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.js39
2 files changed, 29 insertions, 19 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 02579676..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,31 +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.addEventListener("paste", this, false); 26 this.newFileName.element.addEventListener("keyup", this, false);
27 this.newFileName.focus(); 27 this.newFileName.element.focus();
28 this.newFileName.select(); 28 this.newFileName.element.select();
29 } 29 }
30 }, 30 },
31 31
32 handlePaste:{ 32 handleKeyup:{
33 value:function(evt){ 33 value: function(evt){
34 evt.preventDefault(); 34 if(evt.keyCode === 13){
35 evt.target.value = evt.clipboardData.getData("Text"); 35 var enterKeyupEvent = document.createEvent("Events");
36 this.handleKeyup(evt); 36 enterKeyupEvent.initEvent("enterKey", false, false);
37 this.eventManager.dispatchEvent(enterKeyupEvent);
38 }else if(evt.keyCode === 27){
39 var escKeyupEvent = document.createEvent("Events");
40 escKeyupEvent.initEvent("escKey", false, false);
41 this.eventManager.dispatchEvent(escKeyupEvent);
42 }
37 } 43 }
38 }, 44 },
39 45
40 handleKeyup:{ 46 newFileNameChange:{
41 value:function(evt){ 47 value:function(evt){
42 if(this.newFileName.value !== "") { 48 var newFileNameSetEvent = document.createEvent("Events");
43 var newFileNameSetEvent = document.createEvent("Events"); 49 newFileNameSetEvent.initEvent("newFileNameSet", false, false);
44 newFileNameSetEvent.initEvent("newFileNameSet", false, false); 50 newFileNameSetEvent.newFileName = this.newFileName.value;
45 newFileNameSetEvent.newFileName = this.newFileName.value; 51 newFileNameSetEvent.keyCode = evt.keyCode;
46 newFileNameSetEvent.keyCode = evt.keyCode; 52 this.eventManager.dispatchEvent(newFileNameSetEvent);
47 this.eventManager.dispatchEvent(newFileNameSetEvent);
48 }
49 } 53 }
50 } 54 }
51
52}); \ No newline at end of file 55}); \ No newline at end of file