diff options
author | Ananya Sen | 2012-02-13 18:48:18 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-13 18:48:18 -0800 |
commit | a6948e635389768fc316f1fb86df2524b482b47c (patch) | |
tree | 427c0f16696d858d5cc2813749c65a224d14e885 | |
parent | 021dc7f835065a062e65b3325f9b45c5a271cbcf (diff) | |
download | ninja-a6948e635389768fc316f1fb86df2524b482b47c.tar.gz |
added logical drive selection to file picker
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
-rw-r--r-- | js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js | 13 | ||||
-rwxr-xr-x | js/controllers/document-controller.js | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js index ff9c7073..6b0d92f7 100644 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js | |||
@@ -149,6 +149,12 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { | |||
149 | leftNav.appendChild(newDiv); | 149 | leftNav.appendChild(newDiv); |
150 | if(dirObj.uri === this.pickerModel.currentRoot){ | 150 | if(dirObj.uri === this.pickerModel.currentRoot){ |
151 | newDiv.classList.add("highlighted"); | 151 | newDiv.classList.add("highlighted"); |
152 | //enable ok for logical drive selections, when in directory selection mode | ||
153 | if(this.pickerModel.inFileMode === false){ | ||
154 | this.okButton.removeAttribute("disabled"); | ||
155 | //put into selectedItems..currently single selection is supported | ||
156 | this.selectedItems = [dirObj.uri]; | ||
157 | } | ||
152 | } | 158 | } |
153 | 159 | ||
154 | newDiv.addEventListener("click", function(evt){that.handleTopLevelDirectoryClicks(evt, dirObj);}, false); | 160 | newDiv.addEventListener("click", function(evt){that.handleTopLevelDirectoryClicks(evt, dirObj);}, false); |
@@ -571,6 +577,13 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { | |||
571 | if(!evt.target.classList.contains("highlighted")){ | 577 | if(!evt.target.classList.contains("highlighted")){ |
572 | evt.target.classList.add("highlighted"); | 578 | evt.target.classList.add("highlighted"); |
573 | } | 579 | } |
580 | |||
581 | //enable ok for logical drive selections, when in directory selection mode | ||
582 | if(this.pickerModel.inFileMode === false){ | ||
583 | this.okButton.removeAttribute("disabled"); | ||
584 | //put into selectedItems..currently single selection is supported | ||
585 | this.selectedItems = [dirObj.uri]; | ||
586 | } | ||
574 | } | 587 | } |
575 | }, | 588 | }, |
576 | 589 | ||
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index b066a9c2..21445214 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -251,7 +251,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
251 | var closeDocumentIndex = this._findIndexByUUID(id); | 251 | var closeDocumentIndex = this._findIndexByUUID(id); |
252 | this._documents.splice(this._findIndexByUUID(id), 1); | 252 | this._documents.splice(this._findIndexByUUID(id), 1); |
253 | 253 | ||
254 | if(this.activeDocument.uuid === id && this._documents.length > 0) { | 254 | if(this.activeDocument.uuid === id && this._documents.length > 0) {//closing the active document tab |
255 | var nextDocumentIndex = -1 ; | 255 | var nextDocumentIndex = -1 ; |
256 | if((this._documents.length > 0) && (closeDocumentIndex === 0)){ | 256 | if((this._documents.length > 0) && (closeDocumentIndex === 0)){ |
257 | nextDocumentIndex = 1; | 257 | nextDocumentIndex = 1; |
@@ -259,7 +259,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
259 | nextDocumentIndex = closeDocumentIndex - 1; | 259 | nextDocumentIndex = closeDocumentIndex - 1; |
260 | } | 260 | } |
261 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); | 261 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); |
262 | }else{ | 262 | }else if(this._documents.length === 0){ |
263 | //if there are no documents to switch to then just show the iframeContainer | 263 | //if there are no documents to switch to then just show the iframeContainer |
264 | document.getElementById("iframeContainer").style.display="block"; | 264 | document.getElementById("iframeContainer").style.display="block"; |
265 | } | 265 | } |