aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-16 16:06:24 -0700
committerNivesh Rajbhandari2012-04-16 16:06:24 -0700
commitc253192a08b499ea7be46fa5438d273e51f7ec5a (patch)
tree18a1f0e3679c0eb993a9dedb537035d3861f49ac /js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
parente19376c54eedd1f1c457ba405b2f110be376a559 (diff)
parent4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff)
downloadninja-c253192a08b499ea7be46fa5438d273e51f7ec5a.tar.gz
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js')
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js31
1 files changed, 23 insertions, 8 deletions
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