aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/document-controller.js
diff options
context:
space:
mode:
authorhwc4872012-04-19 13:01:43 -0700
committerhwc4872012-04-19 13:01:43 -0700
commite6a20fe64574763483dc602bd759278ccf5e5e68 (patch)
tree69defe7200206f0257fe90697136fadef59d521e /js/controllers/document-controller.js
parentae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff)
parent9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff)
downloadninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/drawing/world.js js/lib/geom/geom-obj.js js/lib/rdge/materials/cloud-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-xjs/controllers/document-controller.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index d5556fa8..ddaeb061 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -38,13 +38,12 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
38 return this._activeDocument; 38 return this._activeDocument;
39 }, 39 },
40 set: function(doc) { 40 set: function(doc) {
41 if(!!this._activeDocument) this._activeDocument.isActive = false; 41 if(!!this._activeDocument){ this._activeDocument.isActive = false;}
42
43 this._activeDocument = doc; 42 this._activeDocument = doc;
44 if(!!this._activeDocument){ 43 if(!!this._activeDocument){
45
46 if(this._documents.indexOf(doc) === -1) this._documents.push(doc); 44 if(this._documents.indexOf(doc) === -1) this._documents.push(doc);
47 this._activeDocument.isActive = true; 45 this._activeDocument.isActive = true;
46
48 if(!!this._activeDocument.editor){ 47 if(!!this._activeDocument.editor){
49 this._activeDocument.editor.focus(); 48 this._activeDocument.editor.focus();
50 } 49 }
@@ -61,6 +60,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
61 this.eventManager.addEventListener("executeSaveAs", this, false); 60 this.eventManager.addEventListener("executeSaveAs", this, false);
62 this.eventManager.addEventListener("executeSaveAll", this, false); 61 this.eventManager.addEventListener("executeSaveAll", this, false);
63 this.eventManager.addEventListener("executeFileClose", this, false); 62 this.eventManager.addEventListener("executeFileClose", this, false);
63 this.eventManager.addEventListener("executeFileCloseAll", this, false);
64 64
65 this.eventManager.addEventListener("styleSheetDirty", this, false); 65 this.eventManager.addEventListener("styleSheetDirty", this, false);
66 66
@@ -71,7 +71,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
71 handleAddComponentFirstDraw: { 71 handleAddComponentFirstDraw: {
72 value: function (e) { 72 value: function (e) {
73 //TODO: Add logic to reparse the document for dynamically added styles 73 //TODO: Add logic to reparse the document for dynamically added styles
74 console.log(e); 74 //console.log(e);
75 } 75 }
76 }, 76 },
77 77
@@ -180,6 +180,17 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
180 } 180 }
181 }, 181 },
182 //////////////////////////////////////////////////////////////////// 182 ////////////////////////////////////////////////////////////////////
183 handleExecuteFileCloseAll:{
184 value: function(event) {
185 var i=0;
186 if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
187 while(this._documents.length > 0){
188 this.closeDocument(this._documents[this._documents.length -1].uuid);
189 }
190 }
191 }
192 },
193 ////////////////////////////////////////////////////////////////////
183 // 194 //
184 fileSaveResult: { 195 fileSaveResult: {
185 value: function (result) { 196 value: function (result) {