diff options
Diffstat (limited to 'js/panels')
9 files changed, 22 insertions, 22 deletions
diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index 4c0a3611..b4a803b2 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | |||
@@ -87,7 +87,7 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre | |||
87 | 87 | ||
88 | populateStyleSheetList: { | 88 | populateStyleSheetList: { |
89 | value: function() { | 89 | value: function() { |
90 | this.sections.sheets.doc = this.application.ninja.currentDocument._document; | 90 | this.sections.sheets.doc = this.application.ninja.currentDocument.model.views.design.document; |
91 | var styleTagCount = 0, | 91 | var styleTagCount = 0, |
92 | sect = this.sections.sheets, | 92 | sect = this.sections.sheets, |
93 | sheetsArray = nj.toArray(sect.doc.styleSheets), | 93 | sheetsArray = nj.toArray(sect.doc.styleSheets), |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 80133edf..c55e5a24 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -596,13 +596,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
596 | 596 | ||
597 | // That's all we need to do for a brand new file. | 597 | // That's all we need to do for a brand new file. |
598 | // But what if we're opening an existing document? | 598 | // But what if we're opening an existing document? |
599 | if (!this.application.ninja.documentController.creatingNewFile) { | 599 | if (!this.application.ninja.documentController.creatingNewFile && this.application.ninja.currentDocument.currentView !== "code") { |
600 | // Opening an existing document. If it has DOM elements we need to restore their timeline info | 600 | // Opening an existing document. If it has DOM elements we need to restore their timeline info |
601 | if (this.application.ninja.currentDocument.documentRoot.children[0]) { | 601 | if (this.application.ninja.currentDocument.model.documentRoot.children[0]) { |
602 | // Yes, it has DOM elements. Loop through them and create a new object for each. | 602 | // Yes, it has DOM elements. Loop through them and create a new object for each. |
603 | for (myIndex = 0; this.application.ninja.currentDocument.documentRoot.children[myIndex]; myIndex++) { | 603 | for (myIndex = 0; this.application.ninja.currentDocument.model.documentRoot.children[myIndex]; myIndex++) { |
604 | this._openDoc = true; | 604 | this._openDoc = true; |
605 | this.restoreLayer(this.application.ninja.currentDocument.documentRoot.children[myIndex]); | 605 | this.restoreLayer(this.application.ninja.currentDocument.model.documentRoot.children[myIndex]); |
606 | } | 606 | } |
607 | } | 607 | } |
608 | } | 608 | } |
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 3d83dc36..ff684446 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -434,7 +434,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
434 | didDraw:{ | 434 | didDraw:{ |
435 | value:function () { | 435 | value:function () { |
436 | if ((!this.application.ninja.documentController.creatingNewFile)||(!this.application.ninja.currentDocument.setLevel)) { | 436 | if ((!this.application.ninja.documentController.creatingNewFile)||(!this.application.ninja.currentDocument.setLevel)) { |
437 | if (this.application.ninja.currentDocument.documentRoot.children[0]) { | 437 | if (this.application.ninja.currentDocument.model.documentRoot.children[0]) { |
438 | var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); | 438 | var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); |
439 | if (selectedIndex !== false) { | 439 | if (selectedIndex !== false) { |
440 | if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { | 440 | if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { |
@@ -588,7 +588,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
588 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); | 588 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); |
589 | this.nextKeyframe = 0; | 589 | this.nextKeyframe = 0; |
590 | 590 | ||
591 | this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); | 591 | this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument.model.views.design.document); |
592 | 592 | ||
593 | for (i =0; this.currentKeyframeRule[i] ;i++) { | 593 | for (i =0; this.currentKeyframeRule[i] ;i++) { |
594 | var newTween = {}; | 594 | var newTween = {}; |
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index e028d1db..3ad1763d 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js | |||
@@ -398,8 +398,8 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
398 | //if(!this.centerStage) { | 398 | //if(!this.centerStage) { |
399 | var top, left; | 399 | var top, left; |
400 | 400 | ||
401 | top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); | 401 | top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.model.documentRoot, "height"))) / 2); |
402 | left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); | 402 | left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.model.documentRoot, "width"))) / 2); |
403 | //this.centerStage = [top, left]; | 403 | //this.centerStage = [top, left]; |
404 | return [left, top]; | 404 | return [left, top]; |
405 | //} | 405 | //} |
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index 5229b92e..454008fa 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js | |||
@@ -30,7 +30,7 @@ exports.StylesViewDelegate = Montage.create(Component, { | |||
30 | value: function(selector, direction) { | 30 | value: function(selector, direction) { |
31 | if(!selector) { return false; } | 31 | if(!selector) { return false; } |
32 | 32 | ||
33 | var elements = this.stylesController._activeDocument._document.querySelectorAll(selector), | 33 | var elements = this.stylesController._activeDocument.model.views.design.document.querySelectorAll(selector), |
34 | method = (direction === "out") ? "remove" : "add"; | 34 | method = (direction === "out") ? "remove" : "add"; |
35 | 35 | ||
36 | Array.prototype.slice.call(elements).forEach(function(el) { | 36 | Array.prototype.slice.call(elements).forEach(function(el) { |
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index b292a66a..e3ecce10 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js | |||
@@ -73,7 +73,7 @@ exports.Properties = Montage.create(Component, { | |||
73 | this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; | 73 | this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; |
74 | 74 | ||
75 | // Display the default document root PI | 75 | // Display the default document root PI |
76 | this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); | 76 | this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot); |
77 | } | 77 | } |
78 | }, | 78 | }, |
79 | 79 | ||
@@ -95,7 +95,7 @@ exports.Properties = Montage.create(Component, { | |||
95 | this.elementId.value = this.elementId.value.replace(/\s/g, ''); | 95 | this.elementId.value = this.elementId.value.replace(/\s/g, ''); |
96 | 96 | ||
97 | // Check if that id is in use | 97 | // Check if that id is in use |
98 | if(this.application.ninja.currentDocument._document.getElementById(this.elementId.value) !== null) { | 98 | if(this.application.ninja.currentDocument.model.views.design.document.getElementById(this.elementId.value) !== null) { |
99 | // TODO: Replace with Ninja Alert | 99 | // TODO: Replace with Ninja Alert |
100 | alert("The following ID: " + this.elementId.value + " is already in use"); | 100 | alert("The following ID: " + this.elementId.value + " is already in use"); |
101 | } | 101 | } |
@@ -104,13 +104,13 @@ exports.Properties = Montage.create(Component, { | |||
104 | // ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); | 104 | // ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); |
105 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi"); | 105 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi"); |
106 | } else { | 106 | } else { |
107 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); | 107 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.id); |
108 | } | 108 | } |
109 | } else if(event.target.id === "elementClass") { | 109 | } else if(event.target.id === "elementClass") { |
110 | if(this.application.ninja.selectedElements.length) { | 110 | if(this.application.ninja.selectedElements.length) { |
111 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); | 111 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); |
112 | } else { | 112 | } else { |
113 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); | 113 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.elementClass); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | } | 116 | } |
@@ -135,7 +135,7 @@ exports.Properties = Montage.create(Component, { | |||
135 | value: function(event) { | 135 | value: function(event) { |
136 | // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update | 136 | // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update |
137 | if(event.detail.source && event.detail.source !== "pi") { | 137 | if(event.detail.source && event.detail.source !== "pi") { |
138 | var el = this.application.ninja.currentDocument.documentRoot; | 138 | var el = this.application.ninja.currentDocument.model.documentRoot; |
139 | if(this.application.ninja.selectedElements.length) { | 139 | if(this.application.ninja.selectedElements.length) { |
140 | el = this.application.ninja.selectedElements[0]; | 140 | el = this.application.ninja.selectedElements[0]; |
141 | } | 141 | } |
@@ -161,7 +161,7 @@ exports.Properties = Montage.create(Component, { | |||
161 | handleSelectionChange: { | 161 | handleSelectionChange: { |
162 | value: function(event) { | 162 | value: function(event) { |
163 | if(event.detail.isDocument) { | 163 | if(event.detail.isDocument) { |
164 | this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); | 164 | this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot); |
165 | } else { | 165 | } else { |
166 | if(this.application.ninja.selectedElements.length === 1) { | 166 | if(this.application.ninja.selectedElements.length === 1) { |
167 | this.displayElementProperties(this.application.ninja.selectedElements[0]); | 167 | this.displayElementProperties(this.application.ninja.selectedElements[0]); |
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index b1fd910d..ae408f11 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js | |||
@@ -116,7 +116,7 @@ exports.CustomSection = Montage.create(Component, { | |||
116 | value: function(event) { | 116 | value: function(event) { |
117 | // Change the stage color for now | 117 | // Change the stage color for now |
118 | //console.log(this, event); | 118 | //console.log(this, event); |
119 | ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); | 119 | ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); |
120 | /* | 120 | /* |
121 | var propEvent = document.createEvent("CustomEvent"); | 121 | var propEvent = document.createEvent("CustomEvent"); |
122 | propEvent.initEvent("propertyChange", true, true); | 122 | propEvent.initEvent("propertyChange", true, true); |
diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.js b/js/panels/properties.reel/sections/position-size.reel/position-size.js index 10e084be..7c24e02a 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.js +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.js | |||
@@ -158,7 +158,7 @@ exports.PositionSize = Montage.create(Component, { | |||
158 | if(!event.wasSetByCode) { | 158 | if(!event.wasSetByCode) { |
159 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 159 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
160 | 160 | ||
161 | this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; | 161 | this.application.ninja.selectedElements.length ? items = this.application.ninja.sele |