From f6f722feecf88c8afe59327eaf8557ce4012abc7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 22:40:02 -0700 Subject: Fixing the dirty document flag. Disabling the stylesheets dirty flag because === true on document open. Signed-off-by: Valerio Virgillito --- .../layout/documents-tab.reel/documents-tab.html | 24 ++++----------------- js/controllers/document-controller.js | 4 ++-- js/controllers/elements/shapes-controller.js | 4 ++-- js/mediators/element-mediator.js | 6 +++--- js/ninja.reel/ninja.js | 25 ---------------------- js/panels/Timeline/Layer.reel/Layer.js | 4 ++-- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 4 ++-- 7 files changed, 15 insertions(+), 56 deletions(-) (limited to 'js') 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 @@ "element": {"#": "document"} }, "bindings": { - "document": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - }, - "name": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.model.file.name", - "oneway": true - }, - "saveFlag": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.model.needsSave", - "oneway": true - }, - "active": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.model.isActive", - "oneway": true - } + "document": {"<-": "@repetition1.objectAtCurrentIteration"}, + "name": {"<-": "@repetition1.objectAtCurrentIteration.model.file.name"}, + "saveFlag": {"<-": "@repetition1.objectAtCurrentIteration.model.needsSave"}, + "active": {"<-": "@repetition1.objectAtCurrentIteration.model.isActive"} } }, 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()){ fileSaveResult: { value: function (result) { if((result.status === 204) || (result.status === 404)){//204=>existing file || 404=>new file... saved - this.activeDocument.needsSave = false; + this.activeDocument.model.needsSave = false; if(this.application.ninja.currentDocument !== null){ //clear Dirty StyleSheets for the saved document this.application.ninja.stylesController.clearDirtyStyleSheets(this.application.ninja.currentDocument); @@ -647,7 +647,7 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ handleStyleSheetDirty:{ value:function(){ - this.activeDocument.needsSave = true; +// this.activeDocument.model.needsSave = true; } }, 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, { default: CanvasController.setProperty(el, p, value); } - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, @@ -559,7 +559,7 @@ exports.ShapesController = Montage.create(CanvasController, { } } el.elementModel.shapeModel.GLWorld.render(); - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, 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, { document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify); - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; if(notify || notify === undefined) { NJevent("elementAdded", elements); @@ -77,7 +77,7 @@ exports.ElementMediator = Montage.create(Component, { document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify); - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; NJevent("elementsRemoved", elements); } @@ -92,7 +92,7 @@ exports.ElementMediator = Montage.create(Component, { document.application.undoManager.add(undoLabel, this.replaceElement, this, oldChild, newChild); - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; if(notify || notify === undefined) { 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, { } }, - _handleAppLoaded: { - value: function(event){ - - /* - Object.defineBinding(docBar, "type", { - boundObject: DocumentManagerModule.DocumentManager, - boundObjectPropertyPath: "activeDocument.documentType" - }); - - Object.defineBinding(docBar, "currentView", { - boundObject: DocumentManagerModule.DocumentManager, - boundObjectPropertyPath: "activeDocument.currentView", - oneway: false - }); - - Object.defineBinding(docBar, "zoomFactor", { - boundObject: DocumentManagerModule.DocumentManager, - boundObjectPropertyPath: "activeDocument.zoomFactor", - oneway: false - }); - */ - - } - }, - setupGlobalHelpers: { value: function() { 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, { this.dynamicLayerName.value = this._layerEditable.value; this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value; this.needsDraw = true; - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, handleAddStyleClick: { @@ -749,7 +749,7 @@ var Layer = exports.Layer = Montage.create(Component, { this.dynamicLayerName.value = newVal; this.layerName = newVal; this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; this.needsDraw = true; } }, 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, { this.nextKeyframe += 1; } - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, @@ -687,7 +687,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { keyframeString += " }"; // set the keyframe string as the new rule this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, -- cgit v1.2.3