aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/file-picker
diff options
context:
space:
mode:
authorhwc4872012-04-13 11:52:13 -0700
committerhwc4872012-04-13 11:52:13 -0700
commit4f2fb5764703cab4ce3ada719b1395ed1e2f3b7c (patch)
tree3dc2e3c5a041179eed38eab1a00f851554e50005 /js/io/ui/file-picker
parent521df0ed9242efff45715998837068c87aca7efd (diff)
parent4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff)
downloadninja-4f2fb5764703cab4ce3ada719b1395ed1e2f3b7c.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Snapping_II
Conflicts: js/helper-classes/3D/view-utils.js js/panels/presets/animations-presets.reel/animations-presets.js js/panels/presets/style-presets.reel/style-presets.js js/panels/presets/transitions-presets.reel/transitions-presets.js js/tools/Translate3DToolBase.js
Diffstat (limited to 'js/io/ui/file-picker')
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.html10
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js37
2 files changed, 26 insertions, 21 deletions
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html
index 2fcaa075..00df1c11 100755
--- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html
+++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html
@@ -10,13 +10,21 @@
10 <link rel="stylesheet" type="text/css" href="file-input-field.css"> 10 <link rel="stylesheet" type="text/css" href="file-input-field.css">
11 <script type="text/montage-serialization"> 11 <script type="text/montage-serialization">
12 { 12 {
13
14 "newFileDirectory": {
15 "prototype": "montage/ui/textfield.reel",
16 "properties": {
17 "element": {"#": "newFileDirectory"}
18 }
19 },
20
13 "owner":{ 21 "owner":{
14 "module": "js/io/ui/file-picker/file-input-field.reel", 22 "module": "js/io/ui/file-picker/file-input-field.reel",
15 "name": "FileInputField", 23 "name": "FileInputField",
16 "properties": { 24 "properties": {
17 "element": {"#": "fileInputField"}, 25 "element": {"#": "fileInputField"},
18 "findDirectory": {"#": "findDirectory"}, 26 "findDirectory": {"#": "findDirectory"},
19 "newFileDirectory": {"#": "newFileDirectory"} 27 "newFileDirectory": {"@": "newFileDirectory"}
20 } 28 }
21 } 29 }
22 } 30 }
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
index 0f66468a..9e77759f 100755
--- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
+++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
@@ -14,14 +14,10 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
14 value: function() { 14 value: function() {
15 var that = this; 15 var that = this;
16 this.findDirectory.identifier = "findDirectory"; 16 this.findDirectory.identifier = "findDirectory";
17
18 this.findDirectory.addEventListener("click", this, false); 17 this.findDirectory.addEventListener("click", this, false);
19 18 this.eventManager.addEventListener("pickerSelectionsDone", this.handleFileInputPickerSelectionsDone, false);
20 this.eventManager.addEventListener("pickerSelectionsDone", function(evt){that.handleFileInputPickerSelectionsDone(evt);}, false); 19 this.addEventListener("change@newFileDirectory.value", this.handleNewFileDirectoryChange, false);
21 20 this.newFileDirectory.element.addEventListener("keyup", this, false);
22 this.newFileDirectory.addEventListener("keyup", function(evt){that.handleNewFileDirectoryOnkeyup(evt);}, false);
23 this.newFileDirectory.addEventListener("paste", this, false);
24 this.newFileDirectory.addEventListener("search", this, false);
25 } 21 }
26 }, 22 },
27 23
@@ -65,15 +61,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
65 } 61 }
66 }, 62 },
67 63
68 handlePaste:{ 64 handleNewFileDirectoryChange:{
69 value:function(evt){
70 evt.preventDefault();
71 evt.target.value = evt.clipboardData.getData("Text");
72 this.handleNewFileDirectoryOnkeyup(evt);
73 }
74 },
75
76 handleNewFileDirectoryOnkeyup:{
77 value:function(evt){ 65 value:function(evt){
78 var newFileDirectorySetEvent = document.createEvent("Events"); 66 var newFileDirectorySetEvent = document.createEvent("Events");
79 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); 67 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false);
@@ -83,9 +71,18 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
83 } 71 }
84 }, 72 },
85 73
86 handleSearch:{ 74
87 value:function(evt){ 75 handleKeyup:{
88 this.handleNewFileDirectoryOnkeyup(evt); 76 value: function(evt){
77 if(evt.keyCode === 13){
78 var enterKeyupEvent = document.createEvent("Events");
79 enterKeyupEvent.initEvent("enterKey", false, false);
80 this.eventManager.dispatchEvent(enterKeyupEvent);
81 }else if(evt.keyCode === 27){
82 var escKeyupEvent = document.createEvent("Events");
83 escKeyupEvent.initEvent("escKey", false, false);
84 this.eventManager.dispatchEvent(escKeyupEvent);
85 }
89 } 86 }
90 }, 87 },
91 88
@@ -110,7 +107,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
110 if(!!obj && obj.uri && obj.uri.length > 0){ 107 if(!!obj && obj.uri && obj.uri.length > 0){
111 selectedUri = obj.uri[0]; 108 selectedUri = obj.uri[0];
112 this.newFileDirectory.value = selectedUri; 109 this.newFileDirectory.value = selectedUri;
113 this.newFileDirectory.focus(); 110 this.newFileDirectory.element.focus();
114 var newFileDirectorySetEvent = document.createEvent("Events"); 111 var newFileDirectorySetEvent = document.createEvent("Events");
115 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); 112 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false);
116 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; 113 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value;