Skip to content

Commit

Permalink
Fix chosen and back to previous list
Browse files Browse the repository at this point in the history
  • Loading branch information
LePetitTim committed Oct 17, 2019
1 parent e93fb7a commit 26d8824
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mapentity/static/mapentity/jquery.deserialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
changeChecked($input, true);
} else if (type == 'checkbox') {
// see below
} else if ($input.prop("tagName") == 'SELECT') {
$input.children("option[value=" + pair[1] + "]").prop("selected", true);
} else {
var oldVal = $input.val();
var newVal = pair[1];
Expand Down
2 changes: 1 addition & 1 deletion mapentity/static/mapentity/mapentity.context.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ MapEntity.Context = new function() {

if (filter && context.filter) {
$(filter).deserialize(context.filter);
$(filter).find('select').trigger("liszt:updated");
$(filter).find('select').trigger("chosen:updated");
}

if (datatable && context.sortcolumns) {
Expand Down
4 changes: 2 additions & 2 deletions mapentity/static/mapentity/mapentity.filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MapEntity.TogglableFilter = L.Class.extend({
this.$button.mouseenter(this.showinfo.bind(this));
this.$button.mouseleave(this.hideinfo.bind(this));

$('#mainfilter').find('select,input').change(function (e) {
$('#mainfilter').find('select').change(function (e) {
self.setfield(this);
});

Expand All @@ -36,7 +36,7 @@ MapEntity.TogglableFilter = L.Class.extend({
$('#mainfilter select[multiple] option:first-child').remove();
$("form#mainfilter").bind("reset", function() {
setTimeout(function() {
$('form#mainfilter select[multiple]').trigger('liszt:updated');
$('form#mainfilter select[multiple]').trigger('chosen:updated');
}, 1);
});
// Make sure filter-set class is added if a choice is selected.
Expand Down

0 comments on commit 26d8824

Please sign in to comment.