Skip to content

Commit e29cfa6

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-87081-video
# Conflicts: # app/code/Magento/PageBuilder/view/adminhtml/requirejs-config.js # app/code/Magento/PageBuilder/view/frontend/web/js/default.js
1 parent 2425b25 commit e29cfa6

File tree

3 files changed

+11
-22
lines changed
  • app/code/Magento/PageBuilder/view/frontend
  • dev/tests/js/jasmine/tests/app/code/Magento/PageBuilder/view/frontend/web/js/content-type/map/appearance/default

3 files changed

+11
-22
lines changed

app/code/Magento/PageBuilder/view/frontend/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<item name="component" xsi:type="string">Magento_PageBuilder/js/widget/show-on-hover</item>
5151
<item name="config" xsi:type="array">
5252
<item name="buttonSelector" xsi:type="string">.pagebuilder-banner-button</item>
53-
<item name="showOverlay" xsi:type="string">on_hover</item>
53+
<item name="showOverlay" xsi:type="string">hover</item>
5454
<item name="dataRole" xsi:type="string">banner</item>
5555
</item>
5656
</item>

app/code/Magento/PageBuilder/view/frontend/web/js/content-type/map/appearance/default/widget.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ define([
1111
return function (config, element) {
1212
var locations,
1313
controls,
14-
mapOptions = {},
15-
$element = $(element);
14+
mapOptions = {};
1615

17-
/**
18-
* Sets height to 300px as default if no height input. But will not be saved to database
19-
*/
20-
if ($element.context.style.height === '') {
21-
$element.height('300px');
22-
}
16+
if (element.hasAttribute('data-locations')) {
17+
18+
/**
19+
* Set map display to none if no locations
20+
*/
21+
if (element.getAttribute('data-locations') === '[]') {
22+
$(element).hide();
2323

24-
if (element.hasAttribute('data-locations') && element.getAttribute('data-locations') !== '[]') {
24+
return;
25+
}
2526
locations = JSON.parse(element.getAttribute('data-locations'));
2627
locations.forEach(function (location) {
2728
location.position.latitude = parseFloat(location.position.latitude);
2829
location.position.longitude = parseFloat(location.position.longitude);
2930
});
3031
controls = element.getAttribute('data-show-controls');
31-
mapOptions.center = locations[0].position;
3232
mapOptions.disableDefaultUI = controls !== 'true';
3333
mapOptions.mapTypeControl = controls === 'true';
3434
new GoogleMap(element, locations, mapOptions);

dev/tests/js/jasmine/tests/app/code/Magento/PageBuilder/view/frontend/web/js/content-type/map/appearance/default/widget.test.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ define([
2323
});
2424

2525
describe('Magento_PageBuilder/js/content-type/map/appearance/default/widget', function () {
26-
it('Sets element height to 300px if no height is set', function () {
27-
var el = document.createElement('div');
28-
29-
mapWidgetInitializer(undefined, el);
30-
31-
expect(el.style.height).toBe('300px');
32-
});
3326

3427
it('Does not call googleMap constructor if element is missing data-locations', function () {
3528
var el = document.createElement('div');
@@ -52,10 +45,6 @@ define([
5245
el,
5346
JSON.parse(locationsJSON),
5447
{
55-
center: {
56-
latitude: 0,
57-
longitude: 0
58-
},
5948
disableDefaultUI: false,
6049
mapTypeControl: true
6150
}

0 commit comments

Comments
 (0)