aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-14 14:38:35 -0700
committerNivesh Rajbhandari2012-05-14 14:38:35 -0700
commitcfd3a44bb7aba54c15fab59eff39ecdffcb7ac11 (patch)
tree80d0309d3e1b8ceae7ced1c327d1060b162d85e1
parent8c014c75b7f7ac7cf854af6d2cc2f8d330335858 (diff)
downloadninja-cfd3a44bb7aba54c15fab59eff39ecdffcb7ac11.tar.gz
Viewport for banner templates so content doesn't push through "body".
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-xjs/controllers/document-controller.js6
-rwxr-xr-xjs/document/templates/banner/index.html19
-rwxr-xr-xjs/document/views/design.js2
3 files changed, 20 insertions, 7 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 3b6eb5bf..3ce4ba81 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -683,11 +683,9 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
683 } 683 }
684 684
685 if(needsRule) { 685 if(needsRule) {
686// rule = sc.addRule('body{}'); 686 rule = sc.addRule('.ninja-body{}');
687// sc.setStyles(rule, styles);
688 rule = sc.addRule('.ninjaUserDoc{}');
689 sc.setStyles(rule, styles); 687 sc.setStyles(rule, styles);
690 sc.addClass(docRoot, "ninjaUserDoc"); 688 sc.addClass(docRoot, "ninja-body");
691 } 689 }
692 } 690 }
693 } 691 }
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