Skip to content

Commit 8868875

Browse files
author
Erik Loyer
committed
Fix sort checkmark and content delete bugs
1 parent 6783aae commit 8868875

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

system/application/views/melons/cantaloupe/js/scalarlenses.jquery.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@
314314
// add sort buttons
315315
let componentContainer = this.getComponentContainer(this.scalarLensObject.components.length);
316316
componentContainer.find('.content-selector-btn-group').remove();
317+
componentContainer.find('.filter-btn-group').remove();
317318
componentContainer.find('.plus-btn-group').remove();
318319
if (this.scalarLensObject.sorts.length > 0) {
319320
this.scalarLensObject.sorts.forEach((sort, sortIndex) => {
@@ -890,7 +891,6 @@
890891

891892
}
892893

893-
894894
this.populateDropdown(button, button.find('.sort-type-list'), null, onClick,
895895
`<li><a data-toggle="modal" data-target="#sortModal"></a></li>`,
896896
[
@@ -906,9 +906,7 @@
906906
{label: "Delete", value: "delete"}
907907
]);
908908

909-
910909
return button;
911-
912910
}
913911

914912
// update sort button
@@ -925,14 +923,12 @@
925923

926924
// on reload, add active class to dropdown list item
927925
let list = element.find('.dropdown-menu li');
926+
list.removeClass('active');
928927
for(let i = 0; i < 7; i++){
929928
let listItemValue = $(list[i]).data('option').value;
930929
if(listItemValue == sortObj["sort-type"]){
931930
$(list[i]).addClass('active');
932931
}
933-
if(listItemValue == 'delete'){
934-
$(list[i]).removeClass('active');
935-
}
936932
}
937933

938934
if(!sortObj) {

0 commit comments

Comments
 (0)