Skip to content

Commit

Permalink
Wrap tomselect code for autocomplete to not expose internal variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Dec 17, 2024
1 parent 93b1a8f commit ece741a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions share/static/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ window.RT.Autocomplete.Classes = {
LinkTargets: 'link-targets'
};

{ // block scope to not expose drag_tomselect and drag_item

let drag_tomselect;
let drag_item;
TomSelect.define('rt_drag_drop', function () {
Expand Down Expand Up @@ -254,4 +256,7 @@ window.RT.Autocomplete.bind = function(from) {
};
});
};

}

htmx.onLoad(function(){ RT.Autocomplete.bind(document) });

0 comments on commit ece741a

Please sign in to comment.