aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-14 15:08:09 -0700
committerValerio Virgillito2012-05-14 15:08:09 -0700
commit835df7fcacda5137f0953892e467e5a84f775b35 (patch)
tree46afb3964a0bf7a09b148fe210467bf45c1274bd /js
parent8d367ec7b4749ad390a0e15bb0418efc60970b54 (diff)
parenta0cca95a60e71b4c35c097e0be4be9cf0814e987 (diff)
downloadninja-835df7fcacda5137f0953892e467e5a84f775b35.tar.gz
Merge pull request #227 from mqg734/Dom-Architecture
Adding wrapper div for banner templates so content doesn't push through "body".
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js6
-rwxr-xr-xjs/document/document-html.js2
-rwxr-xr-xjs/document/templates/banner/index.html19
-rwxr-xr-xjs/document/views/design.js2
4 files changed, 21 insertions, 8 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 3f4fe2ed..48033b61 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -686,11 +686,9 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
686 } 686 }
687 687
688 if(needsRule) { 688 if(needsRule) {
689// rule = sc.addRule('body{}'); 689 rule = sc.addRule('.ninja-body{}');
690// sc.setStyles(rule, styles);
691 rule = sc.addRule('.ninjaUserDoc{}');
692 sc.setStyles(rule, styles); 690 sc.setStyles(rule, styles);
693 sc.addClass(docRoot, "ninjaUserDoc"); 691 sc.addClass(docRoot, "ninja-body");
694 } 692 }
695 } 693 }
696 } 694 }
diff --git a/js/document/document-html.js b/js/document/document-html.js
index f8e88ede..b5203e92 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -105,7 +105,7 @@ exports.HtmlDocument = Montage.create(Component, {
105 this.documentRoot = this.model.views.design.document.body; 105 this.documentRoot = this.model.views.design.document.body;
106 } 106 }
107 //TODO: Why is this needed? 107 //TODO: Why is this needed?
108 this._liveNodeList = this.model.views.design.document.body.getElementsByTagName('*'); 108 this._liveNodeList = this.documentRoot.getElementsByTagName('*');
109 //Initiliazing document model 109 //Initiliazing document model
110 document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); 110 document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body");
111 //Adding observer to know when template is ready 111 //Adding observer to know when template is ready
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index 9da6699b..7b29c038 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -50,6 +50,18 @@
50 .nj-preset-transition { 50 .nj-preset-transition {
51 -webkit-transition: all 450ms linear !important; 51 -webkit-transition: all 450ms linear !important;
52 } 52 }
53
54 ninja-viewport {
55 display: block;
56 margin: 0;
57 padding: 0;
58 border: 0;
59 position: absolute;
60 overflow: visible;
61 top: 0;
62 left: 0;
63 background: #FFF;
64 }
53 65
54 ninja-banner { 66 ninja-banner {
55 display: block; 67 display: block;
@@ -60,7 +72,7 @@
60 overflow: visible; 72 overflow: visible;
61 top: 0; 73 top: 0;
62 left: 0; 74 left: 0;
63 background: #FFF; 75 background: transparent;
64 -webkit-transform-style: preserve-3d; 76 -webkit-transform-style: preserve-3d;
65 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 77 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
66 78
@@ -89,7 +101,10 @@
89 101
90 <body> 102 <body>
91 <ninjaloadinghack></ninjaloadinghack> 103 <ninjaloadinghack></ninjaloadinghack>
92 <ninja-banner></ninja-banner> 104 <ninja-viewport>
105 <!--TODO - rename-->
106 <ninja-banner></ninja-banner>
107 </ninja-viewport>
93 </body> 108 </body>
94 109
95</html> \ No newline at end of file 110</html> \ No newline at end of file
diff --git a/js/document/views/design.js b/js/document/views/design.js
index bff65b7f..3378ad71 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -169,7 +169,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
169 } 169 }
170 //Adjusting margin per size of document 170 //Adjusting margin per size of document
171 //this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important; margin-top: -'+Math.floor(this._template.size.height/2)+'px; margin-left: -'+Math.floor(this._template.size.width/2)+'px}'; 171 //this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important; margin-top: -'+Math.floor(this._template.size.height/2)+'px; margin-left: -'+Math.floor(this._template.size.width/2)+'px}';
172 this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important;}'; 172 this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important;} ninja-banner, ninja-viewport {width: ' + this._template.size.width + 'px; height: ' + this._template.size.height + 'px;}';
173 //Setting content in template 173 //Setting content in template
174 ninjaBanner.innerHTML = banner.innerHTML; 174 ninjaBanner.innerHTML = banner.innerHTML;
175 //Garbage collection 175 //Garbage collection