Skip to content

Commit

Permalink
Breeze integration for list widget
Browse files Browse the repository at this point in the history
  • Loading branch information
vovayatsyuk committed Jan 24, 2022
1 parent b1dcb37 commit d7da462
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
22 changes: 22 additions & 0 deletions view/frontend/layout/breeze_default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="breeze.js">
<arguments>
<argument name="bundles" xsi:type="array">
<item name="default" xsi:type="array">
<item name="items" xsi:type="array">
<item name="Swissup_Testimonials/js/list" xsi:type="array">
<item name="path" xsi:type="string">Swissup_Testimonials/js/breeze/testimonials</item>
<item name="import" xsi:type="array">
<item name="list" xsi:type="string">Swissup_Testimonials/js/list</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
12 changes: 12 additions & 0 deletions view/frontend/web/js/breeze/testimonials.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(function () {
'use strict';

$.widget('testimonialsList', {
component: 'Swissup_Testimonials/js/list',

/** [create description] */
create: function () {
$.testimonialsList(this.options, this.element);
}
});
})();
12 changes: 10 additions & 2 deletions view/frontend/web/js/list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
define(['jquery'], function ($) {
(function (factory) {
'use strict';

if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
$.testimonialsList = factory($);
}
}(function ($) {
'use strict';

return function (config, element) {
Expand Down Expand Up @@ -35,4 +43,4 @@ define(['jquery'], function ($) {
viewMore.on('click', makeAjaxCall);
}
};
});
}));

1 comment on commit d7da462

@ci-swissuplabs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify your commit as it didn't pass some tests

Please sign in to comment.