From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Thu, 24 May 2012 00:07:23 -0700
Subject: Cleaning up referencing to 'documentRoot' and '_document'

Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view.
---
 js/mediators/element-mediator.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'js/mediators')

diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 483dacbc..f71a6f4d 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -86,7 +86,7 @@ exports.ElementMediator = Montage.create(Component, {
     replaceElement: {
         value: function(newChild, oldChild, notify) {
 
-            this.application.ninja.currentDocument.documentRoot.replaceChild(newChild, oldChild);
+            this.application.ninja.currentDocument.model.documentRoot.replaceChild(newChild, oldChild);
 
             var undoLabel = "replace element";
 
@@ -520,7 +520,7 @@ exports.ElementMediator = Montage.create(Component, {
         value: function(layersDraggedArray, layerDroppedAfter) {
             var documentRoot,length;
 
-            documentRoot = this.application.ninja.currentDocument.documentRoot;
+            documentRoot = this.application.ninja.currentDocument.model.documentRoot;
             length = layersDraggedArray.length;
 
             for(var i=0; documentRoot.children[i]; i++) {
-- 
cgit v1.2.3


From bf8a79b0ed1593b5b9e3085373dcdab9aeab055e Mon Sep 17 00:00:00 2001
From: Nivesh Rajbhandari
Date: Thu, 24 May 2012 10:46:28 -0700
Subject: Keyboard arrows were not working because some code had not been
 updated to check updated document model.

Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
---
 js/mediators/keyboard-mediator.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'js/mediators')

diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index 2f55edb4..e2e8e937 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -88,7 +88,7 @@ exports.KeyboardMediator = Montage.create(Component, {
 
             //keyboard controls for html design view
             // TODO - New template mode doesn't set currentView yet.
-            if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.model.currentView === "design")){
+            if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.currentView === "design")) {
 
                 // Don't do anything if an input or other control is focused
                 if(document.activeElement.nodeName !== "BODY") {
@@ -252,7 +252,7 @@ exports.KeyboardMediator = Montage.create(Component, {
     handleKeyup: {
         value: function(evt) {
              //keyboard controls for html design view
-            if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){
+            if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.currentView === "design")) {
                 if(document.activeElement.nodeName !== "BODY") {
                     // Don't do anything if an input or other control is focused
                     return;
-- 
cgit v1.2.3