aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-19 14:19:48 -0700
committerNivesh Rajbhandari2012-03-19 14:20:10 -0700
commitea439c4471948cb7e1dbb98bfa9c2ddc374d48e7 (patch)
treed9113bee7667fc6a65c36bcdf8f92d174917f0b1
parentec58642a7b31165890eb5bef7d95ce59dd0c34a0 (diff)
downloadninja-ea439c4471948cb7e1dbb98bfa9c2ddc374d48e7.tar.gz
Maps - Apply default width and height styles to components if specified. Change default location to Sunnyvale.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js7
-rw-r--r--node_modules/components-data/map.json8
-rw-r--r--node_modules/montage/ui/map.reel/map.html4
-rw-r--r--node_modules/montage/ui/map.reel/map.js4
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
291 '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' 291 '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'
292 }; 292 };
293 293
294 var defaultStyles = component.defaultStyles;
295 if(defaultStyles) {
296 for(var n in defaultStyles) {
297 styles[n] = defaultStyles[n];
298 }
299 }
300
294 that.application.ninja.currentDocument.setComponentInstance(instance, element); 301 that.application.ninja.currentDocument.setComponentInstance(instance, element);
295 302
296 NJevent("elementAdding", {"el": element, "data":styles}); 303 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 @@
18 "default": "" 18 "default": ""
19 } 19 }
20 20
21 ] 21 ],
22
23 "defaultStyles": {
24 "width": "280px",
25 "height": "280px"
26 }
27
22} \ No newline at end of file 28} \ 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 @@
29 .montage-google-map { 29 .montage-google-map {
30 margin: 0; 30 margin: 0;
31 padding: 0; 31 padding: 0;
32 width: 600px; 32 width: 280px;
33 height: 700px; 33 height: 280px;
34 } 34 }
35 35
36 </style> 36 </style>
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/
43 value: false 43 value: false
44 }, 44 },
45 45
46 46 // Sunnyvale, CA
47 defaultLatLng: { 47 defaultLatLng: {
48 value: {lat: -34.397, lng: 150.644} 48 value: {lat: 37.37, lng: -122.03}
49 }, 49 },
50 50
51 _latLng: { 51 _latLng: {