| Line 110... |
Line 110... |
| 110 |
<span class="input-group-addon">${holder3}</span>
|
110 |
<span class="input-group-addon">${holder3}</span>
|
| 111 |
</div>`;
|
111 |
</div>`;
|
| 112 |
$allSlabContainers.html(slabHtml.repeat(9));
|
112 |
$allSlabContainers.html(slabHtml.repeat(9));
|
| 113 |
}
|
113 |
}
|
| 114 |
$(document).on('click', 'a.mk_offer_active', function(){
|
114 |
$(document).on('click', 'a.mk_offer_active', function(){
|
| - |
|
115 |
$clicked = $(this);
|
| 115 |
let offerId = $(this).closest('tr').data("offerid");
|
116 |
let offerId = $clicked.closest('tr').data("offerid");
|
| - |
|
117 |
if(confirm(`Are you sure want to activate ${offerId}?`)){
|
| 116 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}`, function (response) {
|
118 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}`, function (response) {
|
| 117 |
alert("Offer is now active");
|
119 |
alert("Offer is now active");
|
| 118 |
$(this).closest("li").html(`<a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>`);
|
120 |
$clicked.closest("li").html(`<a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>`);
|
| 119 |
});
|
121 |
});
|
| - |
|
122 |
}
|
| 120 |
});
|
123 |
});
|
| 121 |
$(document).on('click', 'a.mk_offer_inactive', function(){
|
124 |
$(document).on('click', 'a.mk_offer_inactive', function(){
|
| - |
|
125 |
$clicked = $(this);
|
| 122 |
let offerId = $(this).closest('tr').data("offerid");
|
126 |
let offerId = $clicked.closest('tr').data("offerid");
|
| - |
|
127 |
if(confirm(`Are you sure want to activate ${offerId}?`)){
|
| 123 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}?active=false`, function (response) {
|
128 |
doGetAjaxRequestHandler(`${context}/offer/active/${offerId}?active=false`, function (response) {
|
| 124 |
alert("Offer is now inactive");
|
129 |
alert("Offer is now inactive");
|
| 125 |
$(this).closest("li").html(`<a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>`);
|
130 |
$clicked.closest("li").html(`<a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>`);
|
| 126 |
});
|
131 |
});
|
| - |
|
132 |
}
|
| 127 |
});
|
133 |
});
|
| 128 |
$(document).on('click', 'button.slab-add', function(){
|
134 |
$(document).on('click', 'button.slab-add', function(){
|
| 129 |
newTargetSlab = $(targetSlabTemplate);
|
135 |
newTargetSlab = $(targetSlabTemplate);
|
| 130 |
$('div.targetslabscontainer').append(newTargetSlab);
|
136 |
$('div.targetslabscontainer').append(newTargetSlab);
|
| 131 |
newTargetSlab.find("select.criteria-brands").toggle().next().remove();
|
137 |
newTargetSlab.find("select.criteria-brands").toggle().next().remove();
|