Skip to content

Commit 2ae9c37

Browse files
ENGCOM-9050: Load resizable jquery-ui chunk for knockout resizable binding only when actually used #32756
2 parents 09067fb + 11678cf commit 2ae9c37

File tree

1 file changed

+6
-3
lines changed
  • app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings

1 file changed

+6
-3
lines changed

app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/resizable.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ define([
88
'Magento_Ui/js/lib/view/utils/async',
99
'uiRegistry',
1010
'underscore',
11-
'../template/renderer',
12-
'jquery-ui-modules/resizable'
11+
'../template/renderer'
1312
], function (ko, $, async, registry, _, renderer) {
1413
'use strict';
1514

@@ -139,7 +138,11 @@ define([
139138
init: function (element, valueAccessor, allBindings, viewModel) {
140139
var config = processConfig(valueAccessor(), viewModel, element);
141140

142-
$(element).resizable(config);
141+
require(['jquery-ui-modules/resizable'], function () {
142+
if ($.fn.resizable) {
143+
$(element).resizable(config);
144+
}
145+
});
143146
}
144147
};
145148

0 commit comments

Comments
 (0)