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 +- js/mediators/io-mediator.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'js') 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 diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 0bff1f3b..c9c7203f 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -83,7 +83,7 @@ exports.IoMediator = Montage.create(Component, { dimensions = {width: String(dimensions[0])+'px', height: String(dimensions[1])+'px'}; // content = content.replace(/Dimensions@@@/gi, "Dimensions@@@"+template.id); - content = content.replace(/ninja-banner {}/gi, "ninja-banner {width: "+dimensions.width+"; height: "+dimensions.height+"}"); + content = content.replace(/ninja-banner {}/gi, "ninja-banner {overflow: hidden; width: "+dimensions.width+"; height: "+dimensions.height+"}"); } // return content; -- cgit v1.2.3