pos-gis/public/assets/js/pages/features/miscellaneous/dual-listbox.min.js

1 line
1.0 KiB
JavaScript
Raw Permalink Normal View History

2024-10-07 06:13:42 +00:00
"use strict";var KTDualListbox={init:function(){$(".dual-listbox").each(function(){var t=$(this),a=null!=t.attr("data-available-title")?t.attr("data-available-title"):"Available options",e=null!=t.attr("data-selected-title")?t.attr("data-selected-title"):"Selected options",l=null!=t.attr("data-add")?t.attr("data-add"):"Add",d=null!=t.attr("data-remove")?t.attr("data-remove"):"Remove",o=null!=t.attr("data-add-all")?t.attr("data-add-all"):"Add All",n=null!=t.attr("data-remove-all")?t.attr("data-remove-all"):"Remove All",i=[];t.children("option").each(function(){var t=$(this).val(),a=$(this).text();i.push({text:a,value:t})});var r=null!=t.attr("data-search")?t.attr("data-search"):"",s=new DualListbox(t.get(0),{addEvent:function(t){console.log(t)},removeEvent:function(t){console.log(t)},availableTitle:a,selectedTitle:e,addButtonText:l,removeButtonText:d,addAllButtonText:o,removeAllButtonText:n,options:i});"false"==r&&s.search.classList.add("dual-listbox__search--hidden")})}};jQuery(document).ready(function(){KTDualListbox.init()});