Skip to content

Commit

Permalink
tom-select 1.4, css updates, hide search, customProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
oyejorge committed Mar 22, 2021
1 parent 785dae9 commit 26236f0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"imask": "^6.0.7",
"litepicker": "^2.0.11",
"nouislider": "^14.6.3",
"tom-select": "^1.3.0"
"tom-select": "^1.4.0"
},
"resolutions": {
"**/**/node-gyp": "^5.0.0"
Expand Down
21 changes: 21 additions & 0 deletions src/pages/_includes/ui/select.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,28 @@
var el;
window.TomSelect && ({% if jekyll.environment == 'development' %}window.tabler_select["select-{{ id }}"] = {% endif %}new TomSelect(el = document.getElementById('select-{{ id }}'), {
copyClassesToDropdown: false,
dropdownClass: 'dropdown-menu',
//dropdownContentClass: 'ts-dropdown-content',
optionClass:'dropdown-item',

{% unless include.show-search %}
controlInput: '<input>',
{% endunless %}
render:{
item: function(data,escape) {
if( data.customProperties ){
return '<div><span class="dropdown-item-indicator">' + data.customProperties + '</span>' + escape(data.text) + '</div>';
}
return '<div>' + escape(data.text) + '</div>';
},
option: function(data,escape){
if( data.customProperties ){
return '<div><span class="dropdown-item-indicator">' + data.customProperties + '</span>' + String(data.text) + '</div>';
}
return '<div>' + String(data.text) + '</div>';
},
},
}));

});
Expand Down
10 changes: 7 additions & 3 deletions src/scss/vendor/_tom-select.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@import "~tom-select/src/scss/tom-select.bootstrap5.scss";

.ts-control.form-select{
border: none !important;
padding: 0 !important;
.ts-control{
.dropdown-menu {
width: 100%;
height: auto;
}


}

0 comments on commit 26236f0

Please sign in to comment.