From d114f222cb48a101ffdb1b88d43823ca16f2c7df Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 11 May 2012 15:15:33 -0700 Subject: Fixing overflow bug for banner templates Ensuring overflow is visible but saved as hidden. --- js/document/document-html.js | 1 - js/document/views/design.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 7e1f1806..4767271f 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -100,7 +100,6 @@ exports.HtmlDocument = Montage.create(Component, { this._document = this.model.views.design.document; //TODO: Remove usage, seems as not needed if (template && template.type === 'banner') { - //this.documentRoot = this.model.views.design.document.body; this.documentRoot = this.model.views.design.document.body.getElementsByTagName('ninja-banner')[0]; } else { this.documentRoot = this.model.views.design.document.body; diff --git a/js/document/views/design.js b/js/document/views/design.js index e838dd49..16d1ac06 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -168,7 +168,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { } } //Adjusting margin per size of document - this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {margin-top: -'+Math.floor(this._template.size.height/2)+'px; margin-left: -'+Math.floor(this._template.size.width/2)+'px}'; + 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}'; //Setting content in template ninjaBanner.innerHTML = banner.innerHTML; //Garbage collection -- cgit v1.2.3 From d68c1ea5163c67ada54ac24f1da69695cc8dfab5 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 11 May 2012 16:22:17 -0700 Subject: Fixing position issue Need to implement centering document. --- js/document/templates/banner/index.html | 4 ++-- js/document/views/design.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'js/document') diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html index 2cd82f51..8e8c96d6 100755 --- a/js/document/templates/banner/index.html +++ b/js/document/templates/banner/index.html @@ -60,8 +60,8 @@ border: 0; position: absolute; overflow: visible; - top: 50%; - left: 50%; + top: 0; + left: 0; background: #FFF; } diff --git a/js/document/views/design.js b/js/document/views/design.js index 16d1ac06..bff65b7f 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -168,7 +168,8 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { } } //Adjusting margin per size of document - 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}'; + //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}'; + this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important;}'; //Setting content in template ninjaBanner.innerHTML = banner.innerHTML; //Garbage collection -- cgit v1.2.3 From 734b6ad96d25bb67d0db4a0a75c331468e194809 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 14 May 2012 12:05:41 -0700 Subject: Fixing 3d to work in banner templates. Signed-off-by: Nivesh Rajbhandari --- js/document/document-html.js | 2 +- js/document/templates/banner/index.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 4767271f..f8e88ede 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -107,7 +107,7 @@ exports.HtmlDocument = Montage.create(Component, { //TODO: Why is this needed? this._liveNodeList = this.model.views.design.document.body.getElementsByTagName('*'); //Initiliazing document model - document.application.njUtils.makeElementModel(this.model.views.design.document.body, "Body", "body"); + document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); //Adding observer to know when template is ready this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); this._observer.observe(this.model.views.design.document.head, {childList: true}); diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html index 8e8c96d6..9da6699b 100755 --- a/js/document/templates/banner/index.html +++ b/js/document/templates/banner/index.html @@ -27,8 +27,6 @@ margin: 0; padding: 0; position: absolute; - -webkit-transform-style: preserve-3d; - -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } html { @@ -63,6 +61,9 @@ top: 0; left: 0; background: #FFF; + -webkit-transform-style: preserve-3d; + -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + } -- cgit v1.2.3 From 8c014c75b7f7ac7cf854af6d2cc2f8d330335858 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 14 May 2012 14:27:55 -0700 Subject: Fixing grid drawing bug. Signed-off-by: Nivesh Rajbhandari --- js/document/document-html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/document') 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, { this.documentRoot = this.model.views.design.document.body; } //TODO: Why is this needed? - this._liveNodeList = this.model.views.design.document.body.getElementsByTagName('*'); + this._liveNodeList = this.documentRoot.getElementsByTagName('*'); //Initiliazing document model document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); //Adding observer to know when template is ready -- cgit v1.2.3 From cfd3a44bb7aba54c15fab59eff39ecdffcb7ac11 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 14 May 2012 14:38:35 -0700 Subject: Viewport for banner templates so content doesn't push through "body". Signed-off-by: Nivesh Rajbhandari --- js/document/templates/banner/index.html | 19 +++++++++++++++++-- js/document/views/design.js | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'js/document') 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 @@ .nj-preset-transition { -webkit-transition: all 450ms linear !important; } + + ninja-viewport { + display: block; + margin: 0; + padding: 0; + border: 0; + position: absolute; + overflow: visible; + top: 0; + left: 0; + background: #FFF; + } ninja-banner { display: block; @@ -60,7 +72,7 @@ overflow: visible; top: 0; left: 0; - background: #FFF; + background: transparent; -webkit-transform-style: preserve-3d; -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); @@ -89,7 +101,10 @@ - + + + + \ 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, { } //Adjusting margin per size of document //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}'; - this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important;}'; + 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;}'; //Setting content in template ninjaBanner.innerHTML = banner.innerHTML; //Garbage collection -- cgit v1.2.3 From 150b6eb2be526627d588a0cf7226ddad7a399b8f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 14 May 2012 16:35:09 -0700 Subject: Fixing banner template Need to implement save, but this cover open and new. --- js/document/document-html.js | 2 +- js/document/templates/banner/index.html | 54 ++++++++++++++++----------------- js/document/views/design.js | 7 +++-- 3 files changed, 31 insertions(+), 32 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index b5203e92..9bbea4c9 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -100,7 +100,7 @@ exports.HtmlDocument = Montage.create(Component, { this._document = this.model.views.design.document; //TODO: Remove usage, seems as not needed if (template && template.type === 'banner') { - this.documentRoot = this.model.views.design.document.body.getElementsByTagName('ninja-banner')[0]; + this.documentRoot = this.model.views.design.document.body.getElementsByTagName('ninja-content')[0]; } else { this.documentRoot = this.model.views.design.document.body; } diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html index 7b29c038..91ef06de 100755 --- a/js/document/templates/banner/index.html +++ b/js/document/templates/banner/index.html @@ -38,10 +38,6 @@ height: 100%; background: #666; } - - ninjaloadinghack { - display: none; - } .active-element-outline { outline: #adff2f solid 2px; @@ -50,32 +46,30 @@ .nj-preset-transition { -webkit-transition: all 450ms linear !important; } - - ninja-viewport { - display: block; - margin: 0; - padding: 0; - border: 0; - position: absolute; - overflow: visible; - top: 0; - left: 0; - background: #FFF; - } - ninja-banner { + ninjaloadinghack { + display: none; + } + + ninja-viewport, ninja-content { display: block; - margin: 0; - padding: 0; - border: 0; - position: absolute; - overflow: visible; - top: 0; - left: 0; - background: transparent; + margin: 0; + padding: 0; + border: 0; + position: absolute; + overflow: visible; + top: 0; + left: 0; + background: transparent; + } + + ninja-viewport { + background: #FFF; + } + + ninja-content { -webkit-transform-style: preserve-3d; -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - } @@ -100,11 +94,15 @@ + + - - + + + + \ No newline at end of file diff --git a/js/document/views/design.js b/js/document/views/design.js index 3378ad71..4c91ff39 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -159,8 +159,9 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { insertBannerContent: { value: function (e) { //Getting first element in DOM (assumes it's root) - var banner = this._bodyFragment.getElementsByTagName('*')[1], - ninjaBanner = this.document.body.getElementsByTagName('ninja-banner')[0]; + //TODO: Ensure wrapper logic is proper + var banner = this._bodyFragment.getElementsByTagName('*')[2], + ninjaBanner = this.document.body.getElementsByTagName('ninja-content')[0]; //Copying attributes to maintain same properties as the banner root for (var n in banner.attributes) { if (banner.attributes[n].value) { @@ -169,7 +170,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { } //Adjusting margin per size of document //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}'; - 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;}'; + this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-content {overflow: visible !important;} ninja-content, ninja-viewport {width: ' + this._template.size.width + 'px; height: ' + this._template.size.height + 'px;}'; //Setting content in template ninjaBanner.innerHTML = banner.innerHTML; //Garbage collection -- cgit v1.2.3