wip
This commit is contained in:
56
public/web/shella/scripts/section.collection-sidebar.js
Normal file
56
public/web/shella/scripts/section.collection-sidebar.js
Normal file
@@ -0,0 +1,56 @@
|
||||
theme.CollectionSidebar = (function() {
|
||||
|
||||
function CollectionSidebar(container) {
|
||||
this.$container = $(container);
|
||||
|
||||
//var sectionId = this.$container.attr('data-section-id');
|
||||
|
||||
//this.settings = {};
|
||||
|
||||
this.namespace = '.collection-sidebar';
|
||||
|
||||
this.onLoad();
|
||||
};
|
||||
|
||||
CollectionSidebar.prototype = $.extend({}, Section.prototype, CollectionSidebar.prototype, {
|
||||
_rangePrice: {
|
||||
init: function() {
|
||||
if(theme.RangeOfPrice) {
|
||||
theme.RangeOfPrice.init();
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
if(theme.RangeOfPrice) {
|
||||
theme.RangeOfPrice.destroy();
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad: function() {
|
||||
if(theme.StickySidebar) {
|
||||
theme.StickySidebar.init(this.$container, true);
|
||||
}
|
||||
|
||||
this._rangePrice.init();
|
||||
|
||||
if(theme.is_loaded) {
|
||||
theme.ImagesLazyLoad.update();
|
||||
theme.ProductReview.update();
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
this.$container.off(this.namespace);
|
||||
|
||||
if(theme.StickySidebar) {
|
||||
theme.StickySidebar.destroy(this.$container, true);
|
||||
}
|
||||
|
||||
this._rangePrice.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
return CollectionSidebar;
|
||||
})();
|
||||
|
||||
$(function() {
|
||||
theme.sections.register('collection-sidebar', theme.CollectionSidebar);
|
||||
});
|
||||
Reference in New Issue
Block a user