Skip to content

Commit

Permalink
destroying then re-applying chosen for some reason auto-selects all o…
Browse files Browse the repository at this point in the history
…ptions. Fix the problem by fixing the table width with css so that the underlying select is already 100%.
  • Loading branch information
Isaac Connor committed Nov 6, 2024
1 parent 6f8f478 commit ade3a01
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions web/skins/classic/views/js/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ function newGroup() {
.done(function(data) {
insertModalHtml('groupdModal', data.html);
$j('#groupModal').modal('show');
$j('.chosen').chosen("destroy");
$j('.chosen').chosen();
$j('#newGroupMonitorIds').chosen({width: "100%"});
})
.fail(logAjaxFail);
}
Expand All @@ -17,16 +16,15 @@ function setGroup( element ) {
}

function editGroup( element ) {
var gid = element.getAttribute('data-group-id');
const gid = element.getAttribute('data-group-id');
if ( !gid ) {
console.log('No group id found in editGroup');
} else {
$j.getJSON(thisUrl + '?request=modal&modal=group&gid=' + gid)
.done(function(data) {
insertModalHtml('groupModal', data.html);
$j('#groupModal').modal('show');
$j('.chosen').chosen("destroy");
$j('.chosen').chosen();
$j('#newGroupMonitorIds').chosen({width: "100%"});
})
.fail(logAjaxFail);
}
Expand Down

0 comments on commit ade3a01

Please sign in to comment.