diff --git a/view/frontend/layout/breeze_default.xml b/view/frontend/layout/breeze_default.xml new file mode 100644 index 0000000..87fcf22 --- /dev/null +++ b/view/frontend/layout/breeze_default.xml @@ -0,0 +1,22 @@ + + + + + + + + + + Swissup_Testimonials/js/breeze/testimonials + + Swissup_Testimonials/js/list + + + + + + + + + diff --git a/view/frontend/web/js/breeze/testimonials.js b/view/frontend/web/js/breeze/testimonials.js new file mode 100644 index 0000000..c4b9c01 --- /dev/null +++ b/view/frontend/web/js/breeze/testimonials.js @@ -0,0 +1,12 @@ +(function () { + 'use strict'; + + $.widget('testimonialsList', { + component: 'Swissup_Testimonials/js/list', + + /** [create description] */ + create: function () { + $.testimonialsList(this.options, this.element); + } + }); +})(); diff --git a/view/frontend/web/js/list.js b/view/frontend/web/js/list.js index 8ac0afe..9626604 100644 --- a/view/frontend/web/js/list.js +++ b/view/frontend/web/js/list.js @@ -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) { @@ -35,4 +43,4 @@ define(['jquery'], function ($) { viewMore.on('click', makeAjaxCall); } }; -}); +}));