diff options
author | Jose Antonio Marquez Russo | 2012-03-08 16:22:31 -0800 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-03-08 16:22:31 -0800 |
commit | b752f7fced5dfb5d16b6f32fadb48bc7e7fdbc28 (patch) | |
tree | 8a25f983cf5fc9eb8aab34a11fe8c90e8604bed3 /js/io/ui/file-picker | |
parent | 4bdb951f2dab6d132ed28ab17888cc819ed811ee (diff) | |
parent | 50e5491f44e577c66dfefb5d22815ef20ea5c1b1 (diff) | |
download | ninja-b752f7fced5dfb5d16b6f32fadb48bc7e7fdbc28.tar.gz |
Merge pull request #30 from ananyasen/FileIO-ananya
FileIO branch pull request
Diffstat (limited to 'js/io/ui/file-picker')
-rwxr-xr-x | js/io/ui/file-picker/file-picker-controller.js | 2 | ||||
-rwxr-xr-x | js/io/ui/file-picker/file-picker-model.js | 6 | ||||
-rw-r--r-- | js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/js/io/ui/file-picker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js index 3b19de83..105dc223 100755 --- a/js/io/ui/file-picker/file-picker-controller.js +++ b/js/io/ui/file-picker/file-picker-controller.js | |||
@@ -104,7 +104,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require | |||
104 | aModel.topLevelDirectories = topLevelDirectories; | 104 | aModel.topLevelDirectories = topLevelDirectories; |
105 | 105 | ||
106 | if(!!topLevelDirectories && !!topLevelDirectories[0]){ | 106 | if(!!topLevelDirectories && !!topLevelDirectories[0]){ |
107 | aModel.currentRoot = topLevelDirectories[0].uri; | 107 | aModel.currentRoot = aModel.currentLogicalDrive = topLevelDirectories[0].uri; |
108 | } | 108 | } |
109 | 109 | ||
110 | //populate the last opened folder first, if none then populate default root | 110 | //populate the last opened folder first, if none then populate default root |
diff --git a/js/io/ui/file-picker/file-picker-model.js b/js/io/ui/file-picker/file-picker-model.js index 09c3ae9c..c92ec586 100755 --- a/js/io/ui/file-picker/file-picker-model.js +++ b/js/io/ui/file-picker/file-picker-model.js | |||
@@ -73,6 +73,12 @@ exports.FilePickerModel = (require("montage/core/core").Montage).create(require( | |||
73 | value:"" | 73 | value:"" |
74 | }, | 74 | }, |
75 | 75 | ||
76 | currentLogicalDrive:{ | ||
77 | writable:true, | ||
78 | enumerable:true, | ||
79 | value:"" | ||
80 | }, | ||
81 | |||
76 | callback:{ | 82 | callback:{ |
77 | writable:true, | 83 | writable:true, |
78 | enumerable:true, | 84 | enumerable:true, |
diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js index 3d99ae4d..7a9d90b4 100644 --- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js +++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js | |||
@@ -346,6 +346,11 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { | |||
346 | var arr = []; | 346 | var arr = []; |
347 | var temp = new String(uri); | 347 | var temp = new String(uri); |
348 | while(temp.indexOf("/") != -1){ | 348 | while(temp.indexOf("/") != -1){ |
349 | |||
350 | if(""+temp === this.pickerModel.currentLogicalDrive){//stop at the logical drive | ||
351 | break; | ||
352 | } | ||
353 | |||
349 | temp = temp.substring(0, temp.lastIndexOf("/")); | 354 | temp = temp.substring(0, temp.lastIndexOf("/")); |
350 | 355 | ||
351 | //populate dropdown irrespective of validity | 356 | //populate dropdown irrespective of validity |
@@ -560,7 +565,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { | |||
560 | enumerable: true, | 565 | enumerable: true, |
561 | writable: false, | 566 | writable: false, |
562 | value : function(evt, dirObj){ | 567 | value : function(evt, dirObj){ |
563 | this.currentURI = dirObj.uri; | 568 | this.currentURI = this.pickerModel.currentLogicalDrive = dirObj.uri; |
564 | 569 | ||
565 | var status = this.pickerViews()[this.selectedPickerView].call(this, dirObj.uri);//dynamically calls the update function of the current picker view | 570 | var status = this.pickerViews()[this.selectedPickerView].call(this, dirObj.uri);//dynamically calls the update function of the current picker view |
566 | 571 | ||