From ea439c4471948cb7e1dbb98bfa9c2ddc374d48e7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 19 Mar 2012 14:19:48 -0700 Subject: Maps - Apply default width and height styles to components if specified. Change default location to Sunnyvale. Signed-off-by: Nivesh Rajbhandari --- .../Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 7 +++++++ node_modules/components-data/map.json | 8 +++++++- node_modules/montage/ui/map.reel/map.html | 4 ++-- node_modules/montage/ui/map.reel/map.js | 4 ++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index 87c68a52..599eeda3 100755 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js @@ -291,6 +291,13 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' }; + var defaultStyles = component.defaultStyles; + if(defaultStyles) { + for(var n in defaultStyles) { + styles[n] = defaultStyles[n]; + } + } + that.application.ninja.currentDocument.setComponentInstance(instance, element); NJevent("elementAdding", {"el": element, "data":styles}); diff --git a/node_modules/components-data/map.json b/node_modules/components-data/map.json index 796b2fad..792a7fe5 100644 --- a/node_modules/components-data/map.json +++ b/node_modules/components-data/map.json @@ -18,5 +18,11 @@ "default": "" } - ] + ], + + "defaultStyles": { + "width": "280px", + "height": "280px" + } + } \ No newline at end of file diff --git a/node_modules/montage/ui/map.reel/map.html b/node_modules/montage/ui/map.reel/map.html index b255ac1e..b39a11a9 100644 --- a/node_modules/montage/ui/map.reel/map.html +++ b/node_modules/montage/ui/map.reel/map.html @@ -29,8 +29,8 @@ .montage-google-map { margin: 0; padding: 0; - width: 600px; - height: 700px; + width: 280px; + height: 280px; } diff --git a/node_modules/montage/ui/map.reel/map.js b/node_modules/montage/ui/map.reel/map.js index 42af218e..cba08a42 100644 --- a/node_modules/montage/ui/map.reel/map.js +++ b/node_modules/montage/ui/map.reel/map.js @@ -43,9 +43,9 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/ value: false }, - + // Sunnyvale, CA defaultLatLng: { - value: {lat: -34.397, lng: 150.644} + value: {lat: 37.37, lng: -122.03} }, _latLng: { -- cgit v1.2.3