aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-30 01:33:20 -0700
committerValerio Virgillito2012-05-30 01:33:20 -0700
commit31b094ee21102f99a4021d505bc3a28527c9e23d (patch)
treea9525ea312f8cc0d25ab6410394f01e974b69068 /js/components
parentd8840eda0d3b3e31fb5a72306fe66608f4f99c2b (diff)
downloadninja-31b094ee21102f99a4021d505bc3a28527c9e23d.tar.gz
Fixing the close document.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/components')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js16
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js15
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js11
3 files changed, 4 insertions, 38 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index 74e89ac1..ac131f2c 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -26,12 +26,12 @@ exports.Breadcrumb = Montage.create(Component, {
26 26
27 this._currentDocument = value; 27 this._currentDocument = value;
28 28
29 if(!this._currentDocument) { 29 if(!value) {
30 this.disabled = true; 30 this.disabled = true;
31 } else {
32 this.disabled = this._currentDocument.currentView !== "design";
31 } 33 }
32 34
33 this.disabled = this._currentDocument.currentView !== "design";
34
35 } 35 }
36 }, 36 },
37 37
@@ -51,15 +51,6 @@ exports.Breadcrumb = Montage.create(Component, {
51 } 51 }
52 }, 52 },
53 53
54 handleCloseDocument: {
55 value: function(){
56 if(!this.application.ninja.documentController.activeDocument && this.application.ninja.currentDocument.currentView !== "code") {
57 this.disabled = true;
58 this.application.ninja.currentSelectedContainer = (this.application.ninja.currentDocument ? this.application.ninja.currentDocument.model.documentRoot : null);
59 }
60 }
61 },
62
63 _container:{ 54 _container:{
64 value:null 55 value:null
65 }, 56 },
@@ -82,7 +73,6 @@ exports.Breadcrumb = Montage.create(Component, {
82 73
83 prepareForDraw: { 74 prepareForDraw: {
84 value: function() { 75 value: function() {
85 this.eventManager.addEventListener("closeDocument", this, false);
86 this.breadcrumbBt.addEventListener("action", this, false); 76 this.breadcrumbBt.addEventListener("action", this, false);
87 } 77 }
88 }, 78 },
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js
index 6a7b0f3f..90d3a207 100755
--- a/js/components/layout/document-bar.reel/document-bar.js
+++ b/js/components/layout/document-bar.reel/document-bar.js
@@ -105,7 +105,6 @@ exports.DocumentBar = Montage.create(Component, {
105 105
106 prepareForDraw: { 106 prepareForDraw: {
107 value: function() { 107 value: function() {
108 this.eventManager.addEventListener( "closeDocument", this, false);
109 this.designView.addEventListener("click", this, false); 108 this.designView.addEventListener("click", this, false);
110 this.codeView.addEventListener("click", this, false); 109 this.codeView.addEventListener("click", this, false);
111 110
@@ -135,19 +134,5 @@ exports.DocumentBar = Montage.create(Component, {
135 this.currentView = event._event.target.id; 134 this.currentView = event._event.target.id;
136 this.application.ninja.documentController.stage.stageView.switchDesignDocViews(event._event.target.id);//switch between design view 135 this.application.ninja.documentController.stage.stageView.switchDesignDocViews(event._event.target.id);//switch between design view
137 } 136 }
138 },
139
140 handleCloseDocument: {
141 value: function() {
142 if(!this.application.ninja.documentController.activeDocument) {
143 this.disabled = true;
144 }
145 }
146 },
147
148 handleOnDocumentChanged:{
149 value:function(event){
150
151 }
152 } 137 }
153}); 138});
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 34e307cb..94056007 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -9,10 +9,6 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.DocumentEntry = Montage.create(Component, { 10exports.DocumentEntry = Montage.create(Component, {
11 11
12 _uuid: {
13 value: null
14 },
15
16 _document: { 12 _document: {
17 value: null 13 value: null
18 }, 14 },
@@ -23,16 +19,11 @@ exports.DocumentEntry = Montage.create(Component, {
23 return this._document; 19 return this._document;
24 }, 20 },
25 set: function(value) { 21 set: function(value) {
26
27 if (this._document === value) { 22 if (this._document === value) {
28 return; 23 return;
29 } 24 }
30 25
31 this._document = value; 26 this._document = value;
32
33 if(value) {
34 this._uuid = value.uuid;
35 }
36 } 27 }
37 }, 28 },
38 29
@@ -87,7 +78,7 @@ exports.DocumentEntry = Montage.create(Component, {
87 78
88 handleCloseButtonAction: { 79 handleCloseButtonAction: {
89 value: function() { 80 value: function() {
90 //this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 81 this.application.ninja.documentController.closeFile(this.document);
91 } 82 }
92 } 83 }
93 84