Hide promolink when multiple aggregated sources
If aggregator is active and multiple sources are selected, promolinks are not displayed
@@ -22,9 +22,6 @@ AjaxFranceLabs.PromolinkWidget = AjaxFranceLabs.AbstractWidget.extend({
widgetContainerNum: 0,
//Methods
-
-
-
buildWidget: function () {
$(this.elm).addClass('promolinkWidget').addClass('widget');
},
@@ -41,6 +38,26 @@ AjaxFranceLabs.PromolinkWidget = AjaxFranceLabs.AbstractWidget.extend({
},
afterRequest: function () {
+ // Do not update and hide if more than one source is selected in aggregator
+ var elm = $(this.elm);
+ if (this.manager.store.isParamDefined("aggregator")) {
+ selectedStr = this.manager.store.get("aggregator").val();
+ if (selectedStr != null && selectedStr != undefined) {
+ var selectedList = selectedStr.split(",");
+ if (selectedList.length > 1 || selectedStr === "") {
+ elm.hide();
+ } else {
+ this.update();
+ }
+ } else {
+ this.update();
+ }
+ } else {
+ this.update();
+ }
+ },
+
+ update: function () {
var self = this;
var data = this.manager.response, elm = $(this.elm);
if (data.promolinkSearchComponent !== undefined) {
