diff options
author | Jose Antonio Marquez | 2012-02-13 21:21:11 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-13 21:21:11 -0800 |
commit | 64f54ffcebf09c570972b91ea5fdb7fe7654e622 (patch) | |
tree | da23792067fa2b1e08dea90996f69a1a695b1bcc | |
parent | f3865671aa75277f6eb35c417408dee9e665589a (diff) | |
parent | 50a40c4e21b9a4d53d6d1fb739d838c0319ab09b (diff) | |
download | ninja-64f54ffcebf09c570972b91ea5fdb7fe7654e622.tar.gz |
Merge branch 'refs/heads/AnanyaFileIO' into FileIO
6 files changed, 50 insertions, 3 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/components/ui/icon-list-basic/icon.reel/icon.js b/js/components/ui/icon-list-basic/icon.reel/icon.js index d934e7f1..b0279207 100755 --- a/js/components/ui/icon-list-basic/icon.reel/icon.js +++ b/js/components/ui/icon-list-basic/icon.reel/icon.js | |||
@@ -22,6 +22,13 @@ var Icon = exports.Icon = Montage.create(Component, { | |||
22 | this.needsDraw = true; | 22 | this.needsDraw = true; |
23 | } | 23 | } |
24 | }, | 24 | }, |
25 | |||
26 | selectedUri:{ | ||
27 | writable:true, | ||
28 | enumerable:true, | ||
29 | value:null | ||
30 | }, | ||
31 | |||
25 | metadata:{ | 32 | metadata:{ |
26 | enumerable:true, | 33 | enumerable:true, |
27 | writable:true, | 34 | writable:true, |
@@ -83,6 +90,13 @@ var Icon = exports.Icon = Montage.create(Component, { | |||
83 | if(this.icondata.creationDate){this.metadata = this.metadata + "<br />" + "Creation date: "+ this.formatTimestamp(this.icondata.creationDate);} | 90 | if(this.icondata.creationDate){this.metadata = this.metadata + "<br />" + "Creation date: "+ this.formatTimestamp(this.icondata.creationDate);} |
84 | if(this.icondata.modifiedDate){this.metadata = this.metadata + "<br />" + "Modified date: "+ this.formatTimestamp(this.icondata.modifiedDate);} | 91 | if(this.icondata.modifiedDate){this.metadata = this.metadata + "<br />" + "Modified date: "+ this.formatTimestamp(this.icondata.modifiedDate);} |
85 | 92 | ||
93 | //show default selection | ||
94 | if(this.icondata.uri === this.selectedUri){ | ||
95 | var selectedItemEvent = document.createEvent("Events"); | ||
96 | selectedItemEvent.initEvent("selectedItem", false, false); | ||
97 | selectedItemEvent.uri = this.icondata.uri; | ||
98 | this.element.dispatchEvent(selectedItemEvent); | ||
99 | } | ||
86 | } | 100 | } |
87 | }, | 101 | }, |
88 | 102 | ||
diff --git a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html index 50a1d61d..0bb79873 100755 --- a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html +++ b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html | |||
@@ -21,6 +21,11 @@ | |||
21 | "boundObject": {"@": "repetition1"}, | 21 | "boundObject": {"@": "repetition1"}, |
22 | "boundObjectPropertyPath": "objectAtCurrentIteration", | 22 | "boundObjectPropertyPath": "objectAtCurrentIteration", |
23 | "oneway": true | 23 | "oneway": true |
24 | }, | ||
25 | "selectedUri": { | ||
26 | "boundObject": {"@": "owner"}, | ||
27 | "boundObjectPropertyPath": "selected", | ||
28 | "oneway": true | ||
24 | } | 29 | } |
25 | } | 30 | } |
26 | }, | 31 | }, |
diff --git a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js index 56eb57c3..d36aa40f 100755 --- a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js +++ b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js | |||
@@ -15,11 +15,17 @@ var IconsList = exports.IconsList = Montage.create(Component, { | |||
15 | }, | 15 | }, |
16 | 16 | ||
17 | iconsViewDataObject:{ | 17 | iconsViewDataObject:{ |
18 | writable:true, | 18 | writable:true, |
19 | enumerable:true, | 19 | enumerable:true, |
20 | value:[] | 20 | value:[] |
21 | }, | 21 | }, |
22 | 22 | ||
23 | selected:{ | ||
24 | writable:true, | ||
25 | enumerable:true, | ||
26 | value:null | ||
27 | }, | ||
28 | |||
23 | willDraw: { | 29 | willDraw: { |
24 | enumerable: false, | 30 | enumerable: false, |
25 | value: function() { | 31 | value: function() { |
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 | } |
diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js index 848e0cb8..f5ab0027 100644 --- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js +++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | |||
@@ -88,6 +88,9 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
88 | var templates = this.newFileModel.prepareContents(this.newFileModel.defaultProjectType); | 88 | var templates = this.newFileModel.prepareContents(this.newFileModel.defaultProjectType); |
89 | this.templateList = iconsListModule.IconsList.create(); | 89 | this.templateList = iconsListModule.IconsList.create(); |
90 | this.templateList.iconsViewDataObject = templates; | 90 | this.templateList.iconsViewDataObject = templates; |
91 | if(templates.length >0){ | ||
92 | this.templateList.selected = templates[0].uri; | ||
93 | } | ||
91 | this.templateList.element = this.templateIcons; | 94 | this.templateList.element = this.templateIcons; |
92 | this.templateList.needsDraw = true; | 95 | this.templateList.needsDraw = true; |
93 | 96 | ||
@@ -161,9 +164,15 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
161 | var templates = this.newFileModel.prepareContents(evt.uri); | 164 | var templates = this.newFileModel.prepareContents(evt.uri); |
162 | if(this.templatesContainer.querySelectorAll(".list").length > 0){ | 165 | if(this.templatesContainer.querySelectorAll(".list").length > 0){ |
163 | this.templateList.iconsViewDataObject = templates; | 166 | this.templateList.iconsViewDataObject = templates; |
167 | if(templates.length >0){ | ||
168 | this.templateList.selected = templates[0].uri; | ||
169 | } | ||
164 | }else{ | 170 | }else{ |
165 | this.templateList = iconsListModule.IconsList.create(); | 171 | this.templateList = iconsListModule.IconsList.create(); |
166 | this.templateList.iconsViewDataObject = templates; | 172 | this.templateList.iconsViewDataObject = templates; |
173 | if(templates.length >0){ | ||
174 | this.templateList.selected = templates[0].uri; | ||
175 | } | ||
167 | this.templateList.element = this.templateIcons; | 176 | this.templateList.element = this.templateIcons; |
168 | this.templateList.needsDraw = true; | 177 | this.templateList.needsDraw = true; |
169 | } | 178 | } |