From 2ba4a6fab3b81b537521760ee5f95f1bc80027f9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 17 May 2012 11:09:45 -0700 Subject: Adding default padding for banner templates. Signed-off-by: Nivesh Rajbhandari --- js/document/views/design.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/document/views/design.js b/js/document/views/design.js index 3b2eb11f..2ccb82d1 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -184,6 +184,10 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { this._bodyFragment = null; //Calling standard method to finish opening document this.bodyContentLoaded(null); + + // TODO: Clean up this code + this.application.ninja.stage.documentOffsetLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2); + this.application.ninja.stage.documentOffsetTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2); } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 6ce2f2a5af1bc66d8dbec04abfae2e07f43afcfe Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 17 May 2012 11:22:03 -0700 Subject: Fixed chrome preview for banner templates. Signed-off-by: Nivesh Rajbhandari --- js/document/templates/banner/main.js | 8 +++++++- js/document/templates/banner/package.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/js/document/templates/banner/main.js b/js/document/templates/banner/main.js index d5ac88d5..2acbe8f3 100644 --- a/js/document/templates/banner/main.js +++ b/js/document/templates/banner/main.js @@ -4,7 +4,9 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; + Component = require("montage/ui/component").Component, + Template = require("montage/ui/template").Template, + TemplateCreator = require("tools/template/template-creator").TemplateCreator; exports.Main = Montage.create(Component, { @@ -37,6 +39,10 @@ exports.Main = Montage.create(Component, { }; + window.mjsTemplateCreator = TemplateCreator; + // + window.mjsTemplate = Template; + // Dispatch event when this template has loaded. /* var newEvent = document.createEvent( "CustomEvent" ); diff --git a/js/document/templates/banner/package.json b/js/document/templates/banner/package.json index d1e839dc..4f36090a 100755 --- a/js/document/templates/banner/package.json +++ b/js/document/templates/banner/package.json @@ -4,6 +4,7 @@ }, "mappings": { "montage": "../../../../node_modules/montage/", + "tools": "../../../../node_modules/tools/", "montage-google": "../../../../node_modules/montage-google/" } } \ No newline at end of file -- cgit v1.2.3