Skip to content

Commit 02fe295

Browse files
committed
MAGETWO-92406: Pagebuilder - Initial load of Storefront with Tabs does not allow click between tabs
- Ensure we init ui.tabs not mage.tabs for Page Builder
1 parent 3128f26 commit 02fe295

File tree

1 file changed

+17
-15
lines changed
  • app/code/Magento/PageBuilder/view/frontend/web/js

1 file changed

+17
-15
lines changed

app/code/Magento/PageBuilder/view/frontend/web/js/default.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ requirejs([
99
'jquery',
1010
'Magento_PageBuilder/js/utils/map',
1111
'jquery/ui',
12-
'mage/tabs',
1312
'slick',
1413
'jarallax'
1514
], function ($, GoogleMap) {
@@ -105,20 +104,23 @@ requirejs([
105104
showButtonOnHover($('div[data-role="slide"][data-show-button="hover"] > a'), '.pagebuilder-slide-button');
106105

107106
$('div[data-role="tabs"]').each(function (index, element) {
108-
$(element).tabs({
109-
active: $(element).data('active-tab') || 0,
110-
create:
111-
112-
/**
113-
* Adjust the margin bottom of the navigation to correctly display the active tab
114-
*/
115-
function () {
116-
var borderWidth = parseInt($(this).find('.tabs-content').css('borderWidth').toString(), 10);
117-
118-
$(this).find('.tabs-navigation').css('marginBottom', -borderWidth);
119-
$(this).find('.tabs-navigation li:not(:first-child)').css('marginLeft', -borderWidth);
120-
}
121-
});
107+
$.ui.tabs(
108+
{
109+
active: $(element).data('active-tab') || 0,
110+
create:
111+
112+
/**
113+
* Adjust the margin bottom of the navigation to correctly display the active tab
114+
*/
115+
function () {
116+
var borderWidth = parseInt($(this).find('.tabs-content').css('borderWidth').toString(), 10);
117+
118+
$(this).find('.tabs-navigation').css('marginBottom', -borderWidth);
119+
$(this).find('.tabs-navigation li:not(:first-child)').css('marginLeft', -borderWidth);
120+
}
121+
},
122+
$(element)
123+
);
122124
});
123125
});
124126

0 commit comments

Comments
 (0)