Skip to content

Commit f6de403

Browse files
committed
PB-46: Parallax Is Broken On Slide Out Forms
- Fix full screen issues with dynamic block and CMS block
1 parent 16ac37c commit f6de403

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

app/code/Magento/PageBuilder/view/adminhtml/requirejs-config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ var config = {
3535
},
3636
'Magento_Ui/js/form/form': {
3737
'Magento_PageBuilder/js/form/form-mixin': true
38+
},
39+
'Magento_PageBuilder/js/content-type/row/appearance/default/widget': {
40+
'Magento_PageBuilder/js/content-type/row/appearance/default/widget-mixin': true
3841
}
3942
}
4043
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
define(['underscore', 'jquery', 'Magento_PageBuilder/js/events'], function (_, $, events) {
2+
'use strict';
3+
4+
return function (target) {
5+
return function (config, element) {
6+
var result = target(config, element),
7+
stageId = $(element).parents('[data-role="pagebuilder-stage"]').attr('id'),
8+
$element = $(element);
9+
10+
if ($element.data('appearance') === 'contained') {
11+
$element = $(element).find('[data-element="inner"]');
12+
}
13+
14+
// If Parallax isn't enabled, let's not attach the event
15+
if ($element.data('enableParallax') !== 1) {
16+
return result;
17+
}
18+
19+
// Listen for full screen events and destroy and rebuild jarallax
20+
events.on('stage:' + stageId + ':fullScreenModeChangeAfter', function () {
21+
_.delay(function () {
22+
try {
23+
window.jarallax($element[0], 'destroy');
24+
} catch (e) {
25+
// Failure of destroying is acceptable
26+
}
27+
target(config, element);
28+
}, 350);
29+
});
30+
31+
return result;
32+
};
33+
};
34+
});

0 commit comments

Comments
 (0)