aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-10 22:40:02 -0700
committerValerio Virgillito2012-05-10 22:40:02 -0700
commitf6f722feecf88c8afe59327eaf8557ce4012abc7 (patch)
tree78d22ad99979c5305481fd20a5ba59f327f9f057 /js
parentdcefa362576626813111b7d3a708d28834c22f8a (diff)
downloadninja-f6f722feecf88c8afe59327eaf8557ce4012abc7.tar.gz
Fixing the dirty document flag. Disabling the stylesheets dirty flag because === true on document open.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/layout/documents-tab.reel/documents-tab.html24
-rwxr-xr-xjs/controllers/document-controller.js4
-rwxr-xr-xjs/controllers/elements/shapes-controller.js4
-rwxr-xr-xjs/mediators/element-mediator.js6
-rwxr-xr-xjs/ninja.reel/ninja.js25
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js4
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js4
7 files changed, 15 insertions, 56 deletions
diff --git a/js/components/layout/documents-tab.reel/documents-tab.html b/js/components/layout/documents-tab.reel/documents-tab.html
index cf3dbbf5..304c8871 100755
--- a/js/components/layout/documents-tab.reel/documents-tab.html
+++ b/js/components/layout/documents-tab.reel/documents-tab.html
@@ -26,26 +26,10 @@
26 "element": {"#": "document"} 26 "element": {"#": "document"}
27 }, 27 },
28 "bindings": { 28 "bindings": {
29 "document": { 29 "document": {"<-": "@repetition1.objectAtCurrentIteration"},
30 "boundObject": {"@": "repetition1"}, 30 "name": {"<-": "@repetition1.objectAtCurrentIteration.model.file.name"},
31 "boundObjectPropertyPath": "objectAtCurrentIteration", 31 "saveFlag": {"<-": "@repetition1.objectAtCurrentIteration.model.needsSave"},
32 "oneway": true 32 "active": {"<-": "@repetition1.objectAtCurrentIteration.model.isActive"}
33 },
34 "name": {
35 "boundObject": {"@": "repetition1"},
36 "boundObjectPropertyPath": "objectAtCurrentIteration.model.file.name",
37 "oneway": true
38 },
39 "saveFlag": {
40 "boundObject": {"@": "repetition1"},
41 "boundObjectPropertyPath": "objectAtCurrentIteration.model.needsSave",
42 "oneway": true
43 },
44 "active": {
45 "boundObject": {"@": "repetition1"},
46 "boundObjectPropertyPath": "objectAtCurrentIteration.model.isActive",
47 "oneway": true
48 }
49 } 33 }
50 }, 34 },
51 35
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 84e9f4fc..0fd13be2 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -235,7 +235,7 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
235 fileSaveResult: { 235 fileSaveResult: {
236 value: function (result) { 236 value: function (result) {
237 if((result.status === 204) || (result.status === 404)){//204=>existing file || 404=>new file... saved 237 if((result.status === 204) || (result.status === 404)){//204=>existing file || 404=>new file... saved
238 this.activeDocument.needsSave = false; 238 this.activeDocument.model.needsSave = false;
239 if(this.application.ninja.currentDocument !== null){ 239 if(this.application.ninja.currentDocument !== null){
240 //clear Dirty StyleSheets for the saved document 240 //clear Dirty StyleSheets for the saved document
241 this.application.ninja.stylesController.clearDirtyStyleSheets(this.application.ninja.currentDocument); 241 this.application.ninja.stylesController.clearDirtyStyleSheets(this.application.ninja.currentDocument);
@@ -647,7 +647,7 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
647 647
648 handleStyleSheetDirty:{ 648 handleStyleSheetDirty:{
649 value:function(){ 649 value:function(){
650 this.activeDocument.needsSave = true; 650// this.activeDocument.model.needsSave = true;
651 } 651 }
652 }, 652 },
653 653
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index e9a5f865..38f133b5 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -213,7 +213,7 @@ exports.ShapesController = Montage.create(CanvasController, {
213 default: 213 default:
214 CanvasController.setProperty(el, p, value); 214 CanvasController.setProperty(el, p, value);
215 } 215 }
216 this.application.ninja.documentController.activeDocument.needsSave = true; 216 this.application.ninja.documentController.activeDocument.model.needsSave = true;
217 } 217 }
218 }, 218 },
219 219
@@ -559,7 +559,7 @@ exports.ShapesController = Montage.create(CanvasController, {
559 } 559 }
560 } 560 }
561 el.elementModel.shapeModel.GLWorld.render(); 561 el.elementModel.shapeModel.GLWorld.render();
562 this.application.ninja.documentController.activeDocument.needsSave = true; 562 this.application.ninja.documentController.activeDocument.model.needsSave = true;
563 } 563 }
564 }, 564 },
565 565
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 06514076..483dacbc 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -48,7 +48,7 @@ exports.ElementMediator = Montage.create(Component, {
48 48
49 document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify); 49 document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify);
50 50
51 this.application.ninja.documentController.activeDocument.needsSave = true; 51 this.application.ninja.documentController.activeDocument.model.needsSave = true;
52 52
53 if(notify || notify === undefined) { 53 if(notify || notify === undefined) {
54 NJevent("elementAdded", elements); 54 NJevent("elementAdded", elements);
@@ -77,7 +77,7 @@ exports.ElementMediator = Montage.create(Component, {
77 77
78 document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify); 78 document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify);
79 79
80 this.application.ninja.documentController.activeDocument.needsSave = true; 80 this.application.ninja.documentController.activeDocument.model.needsSave = true;
81 81
82 NJevent("elementsRemoved", elements); 82 NJevent("elementsRemoved", elements);
83 } 83 }
@@ -92,7 +92,7 @@ exports.ElementMediator = Montage.create(Component, {
92 92
93 document.application.undoManager.add(undoLabel, this.replaceElement, this, oldChild, newChild); 93 document.application.undoManager.add(undoLabel, this.replaceElement, this, oldChild, newChild);
94 94
95 this.application.ninja.documentController.activeDocument.needsSave = true; 95 this.application.ninja.documentController.activeDocument.model.needsSave = true;
96 96
97 if(notify || notify === undefined) { 97 if(notify || notify === undefined) {
98 NJevent("elementReplaced", {type : "replaceElement", data: {"newChild": newChild, "oldChild": oldChild}}); 98 NJevent("elementReplaced", {type : "replaceElement", data: {"newChild": newChild, "oldChild": oldChild}});
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index f518378a..3fcce925 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -346,31 +346,6 @@ exports.Ninja = Montage.create(Component, {
346 } 346 }
347 }, 347 },
348 348
349 _handleAppLoaded: {
350 value: function(event){
351
352 /*
353 Object.defineBinding(docBar, "type", {
354 boundObject: DocumentManagerModule.DocumentManager,
355 boundObjectPropertyPath: "activeDocument.documentType"
356 });
357
358 Object.defineBinding(docBar, "currentView", {
359 boundObject: DocumentManagerModule.DocumentManager,
360 boundObjectPropertyPath: "activeDocument.currentView",
361 oneway: false
362 });
363
364 Object.defineBinding(docBar, "zoomFactor", {
365 boundObject: DocumentManagerModule.DocumentManager,
366 boundObjectPropertyPath: "activeDocument.zoomFactor",
367 oneway: false
368 });
369 */
370
371 }
372 },
373
374 setupGlobalHelpers: { 349 setupGlobalHelpers: {
375 value: function() { 350 value: function() {
376 351
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index b23da749..6358a0e0 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -721,7 +721,7 @@ var Layer = exports.Layer = Montage.create(Component, {
721 this.dynamicLayerName.value = this._layerEditable.value; 721 this.dynamicLayerName.value = this._layerEditable.value;
722 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value; 722 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value;
723 this.needsDraw = true; 723 this.needsDraw = true;
724 this.application.ninja.documentController.activeDocument.needsSave = true; 724 this.application.ninja.documentController.activeDocument.model.needsSave = true;
725 } 725 }
726 }, 726 },
727 handleAddStyleClick: { 727 handleAddStyleClick: {
@@ -749,7 +749,7 @@ var Layer = exports.Layer = Montage.create(Component, {
749 this.dynamicLayerName.value = newVal; 749 this.dynamicLayerName.value = newVal;
750 this.layerName = newVal; 750 this.layerName = newVal;
751 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; 751 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal;
752 this.application.ninja.documentController.activeDocument.needsSave = true; 752 this.application.ninja.documentController.activeDocument.model.needsSave = true;
753 this.needsDraw = true; 753 this.needsDraw = true;
754 } 754 }
755 }, 755 },
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index efeeba00..2c15a99c 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -568,7 +568,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
568 this.nextKeyframe += 1; 568 this.nextKeyframe += 1;
569 } 569 }
570 570
571 this.application.ninja.documentController.activeDocument.needsSave = true; 571 this.application.ninja.documentController.activeDocument.model.needsSave = true;
572 } 572 }
573 }, 573 },
574 574
@@ -687,7 +687,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
687 keyframeString += " }"; 687 keyframeString += " }";
688 // set the keyframe string as the new rule 688 // set the keyframe string as the new rule
689 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); 689 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString);
690 this.application.ninja.documentController.activeDocument.needsSave = true; 690 this.application.ninja.documentController.activeDocument.model.needsSave = true;
691 } 691 }
692 }, 692 },
693 693