diff --git a/README.md b/README.md
index b5d70f3..4f674a8 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ LC Select has been created focusing on these aspects: a pure javascript (ES6) pl
- (optional) searchbar with minimum fields threshold
- (optional) maximum selectable options
- complete keyboard events integration
-- option images support
+- option images, icons support
- mobile ready
- multilanguage ready
@@ -50,18 +50,20 @@ new lc_select('select');
## Specific HTML attributes
-There are two optional attributes you can use to take advantage of plugin functionalities:
+There are three optional attributes you can use to take advantage of plugin functionalities:
- **data-placeholder:** to be used on the *select* HTML tag, sets field placeholder in case of no option selected (check also *pre_placeh_opt* option for simple selects)
- **data-image:** to be used on *optgroup* or *option* HTML tags, sets option's image
+- **data-icon:** to be used on *optgroup* or *option* HTML tags, sets option's icon (has priority over data-image)
+
```
Italy
France
- Spain
+ Spain
```
diff --git a/lc_select.js b/lc_select.js
index 076730a..04a8f1a 100644
--- a/lc_select.js
+++ b/lc_select.js
@@ -378,14 +378,16 @@
select.querySelectorAll('option').forEach(opt => {
if(opt.selected) {
- const img = (opt.hasAttribute('data-image')) ? ' ' : '';
-
+ const img = (opt.hasAttribute('data-image')) ? ' ' : '',
+ icon = opt.hasAttribute('data-icon') ? ' ' : '';
+
+ const image = icon.length ? icon : img;
if(is_multiple) {
- code += '
'+ img + opt.innerHTML +'
';
+ code += ''+ image + opt.innerHTML +'
';
}
else {
- const single_placeh_mode = (options.pre_placeh_opt && opt.hasAttribute('data-lcslt-placeh')) ? 'class="lcslt-placeholder"' : '';
- code = ''+ img + opt.innerHTML +' ';
+ const single_placeh_mode = (options.pre_placeh_opt && opt.hasAttribute('data-lcslt-placeh')) ? 'class="lcslt-placeholder"' : '';
+ code = ''+ image + opt.innerHTML +' ';
}
sel_opts++;
@@ -501,6 +503,7 @@
group_name : [map] {
opt_val : {
img : (string) ,
+ icon : (string) ,
name : (string),
selected: (bool),
disabled: (bool)
@@ -530,6 +533,7 @@
let obj = {
img : (opt.hasAttribute('data-image')) ? opt.getAttribute('data-image').trim() : '',
+ icon : (opt.hasAttribute('data-icon')) ? opt.getAttribute('data-icon').trim() : '',
name : opt.innerHTML,
selected: opt.selected,
disabled: opt.disabled,
@@ -577,10 +581,16 @@
const dis_class = (disabled_groups.indexOf(group) !== -1) ? 'lcslt-disabled': '';
const optgroup = select.querySelector('optgroup[label="'+ group_key +'"]'),
- img = (optgroup.hasAttribute('data-image') && optgroup.getAttribute('data-image')) ? ' ' : '';
+ img = (optgroup.hasAttribute('data-image') && optgroup.getAttribute('data-image'))
+ ? ' '
+ : '',
+ icon = (optgroup.hasAttribute('data-icon') && optgroup.getAttribute('data-icon'))
+ ? ' ' : '';
+
+ const image = icon.length ? icon : img;
code +=
- ''+ img + group_key +' ' +
+ ''+ image + group_key +' ' +
'';
}
@@ -588,6 +598,7 @@
structure.get(group_key).forEach((opt, opt_key) => {
const vals = structure.get(group_key).get(opt_key),
img = (vals.img) ? ' ' : '',
+ icon = (vals.icon) ? ' ' : '',
sel_class = (vals.selected) ? 'lcslt-selected' : '',
dis_class = (vals.disabled || disabled_groups.indexOf(group) !== -1) ? 'lcslt-disabled': '',
hlight_class = (!highligh_set && sel_class) ? 'lcslt-dd-opt-hlight' : '';
@@ -597,9 +608,10 @@
return;
}
+ const image = icon.length ? icon : img;
code +=
''+
- ''+ img + vals.name +' '+
+ ''+ image + vals.name +' '+
' ';
});
diff --git a/lc_select.min.js b/lc_select.min.js
index dc4206d..bd283e8 100644
--- a/lc_select.min.js
+++ b/lc_select.min.js
@@ -6,30 +6,4 @@
* Licensed under the MIT license
*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(n){return n.raw=n};$jscomp.createTemplateTagFirstArgWithRaw=function(n,t){n.raw=t;return n};$jscomp.arrayIteratorImpl=function(n){var t=0;return function(){return t /g,">").replace(/"/g,""").replace(/'/g,"'");"object"==typeof e.addit_classes&&e.addit_classes.some(function(m){b.classList.add(m)});"auto"!=e.wrap_width&&(b.style.width="inherit"==e.wrap_width?Math.round(a.getBoundingClientRect().width)+"px":e.wrap_width);
-b.classList.add("lcslt-wrap",d);b.innerHTML='
';a.parentNode.insertBefore(b,a);b.appendChild(a);var k=b.querySelector(".lcslt");if(e.pre_placeh_opt&&!p&&r){var f=!0;a.querySelectorAll("option").forEach(function(m){if(m.hasAttribute("selected"))return f=!1});f&&(d=document.createElement("option"),d.setAttribute("data-lcslt-placeh",1),d.setAttribute("value",
-""),d.style.display="none",d.innerHTML=r,d.selected=!0,a.insertBefore(d,a.firstChild))}this.set_sel_content(k);k.addEventListener("click",function(m){k.classList.contains("lcslt-disabled")||m.target.classList.contains("lcslt-multi-selected")||m.target.classList.contains("lcslt-max-opts")||m.target.parentNode.classList.contains("lcslt-multi-selected")||c.show_dd(k)});b.querySelector(".lcslt-tabindex-trick").onfocus=function(m){k.click()}};this.set_sel_content=function(a){(a=void 0===a?!1:a)||(a=l);
-var c=this,b=a.nextSibling,d=a.classList.contains("lcslt-multiple"),h="",p=0,q=0;b.querySelectorAll("option").forEach(function(k){if(k.selected){var f=k.hasAttribute("data-image")?' ":"";h=d?h+(''+f+k.innerHTML+"
"):"'+f+k.innerHTML+" ";q++}p++});var r=!1;"number"==typeof e.max_opts&&1=e.max_opts?(a.classList.add("lcslt-max-opts"),r=!0):a.classList.remove("lcslt-max-opts"));h?d&&p>q&&!b.disabled&&!r&&(h+='+ '):h=''+a.getAttribute("data-placeh")+" ";a.innerHTML=h;d&&a.querySelectorAll(".lcslt-multi-selected").forEach(function(k){k.addEventListener("click",function(f){for(var m=
-f.target;null!=m.parentNode&&!m.matches(".lcslt");)m=m.parentNode;m.classList.contains("lcslt-disabled")||c.deselect_option(f,a,k)})})};this.show_dd=function(a){document.querySelector("#lc-select-dd")&&(document.querySelector("#lc-select-dd").remove(),l.classList.remove("lcslt_dd-open"));if(a==l)return l=null,!1;l=a;this.append_dd();this.set_dd_position();z();var c=this,b=document.querySelector("#lc-select-dd");b.classList.add("lcslt-shown");a.classList.add("lcslt_dd-open");setTimeout(function(){a.getBoundingClientRect().x!=
-b.getBoundingClientRect().x&&c.set_dd_position()},10)};this.set_dd_position=function(){var a=document.querySelector("#lc-select-dd"),c=l.getBoundingClientRect(),b=c.width.toFixed(2),d=parseInt(l.clientHeight,10)+parseInt(getComputedStyle(l).borderTopWidth,10);d=parseInt(c.y,10)+parseInt(window.pageYOffset,10)+d;c=c.left.toFixed(2);0>c&&(c=0);a.setAttribute("style","width:"+b+"px; top:"+d+"px; left: "+c+"px;")};this.append_dd=function(){var a=this,c=this,b=l.parentNode.querySelector("select"),d=new Map,
-h=!1,p=[];b.querySelectorAll("optgroup").length?b.querySelectorAll("optgroup").forEach(function(f){d.set(f.getAttribute("label"),new Map);f.disabled&&p.push(f.getAttribute("label"))}):(h=!0,d.set("%%lcslt%%",new Map));b.querySelectorAll("option").forEach(function(f){var m={img:f.hasAttribute("data-image")?f.getAttribute("data-image").trim():"",name:f.innerHTML,selected:f.selected,disabled:f.disabled},w=h?"%%lcslt%%":f.parentNode.getAttribute("label");(h||w)&&d.get(w).set(f.getAttribute("value"),m)});
-var q=l.classList.contains("lcslt-multiple")?"lcslt-multiple-dd":"",r="object"==typeof e.addit_classes?e.addit_classes.join(" "):"",k='';(r=e.enable_search&&b.querySelectorAll("option").length>=parseInt(e.min_for_search,10)?!0:!1)&&(k+='
');k+='
");document.querySelectorAll(".lcslt-dd-opt").forEach(function(f){f.addEventListener("click",function(m){c.clicked_dd_option(m,f)});f.addEventListener("mouseenter",
-function(m){document.querySelector(".lcslt-dd-opt-hlight")&&document.querySelector(".lcslt-dd-opt-hlight").classList.remove("lcslt-dd-opt-hlight");f.classList.contains("lcslt-disabled")||f.classList.add("lcslt-dd-opt-hlight")});f.addEventListener("mouseleave",function(m){f.classList.remove("lcslt-dd-opt-hlight")})});r&&(1024a.length)document.getElementById("lc-select-dd").classList.remove("lcslt-is-searching"),c.forEach(function(q){q.style.removeProperty("display")}),b.forEach(function(q){q.style.removeProperty("display")}),d&&d.remove();else{document.getElementById("lc-select-dd").classList.add("lcslt-is-searching");c.forEach(function(q){q.style.display="none"});var h=a.split(" "),
-p=!0;b.forEach(function(q){var r=!1;h.some(function(k){-1!==q.querySelector("span").innerHTML.toLowerCase().indexOf(k.toLowerCase())&&(r=!0,p=!1)});r?q.style.removeProperty("display"):q.style.display="none"});p?d||document.querySelector(".lc-select-dd-scroll").insertAdjacentHTML("beforeend",''+e.labels[3]+" "):d.remove()}};this.debounce=function(a,c,b,d){"undefined"!=typeof n[a]&&n[a]&&clearTimeout(n[a]);var h=this;n[a]=setTimeout(function(){h[b].call(h,
-d)},c)};this.generate_style=function(){document.head.insertAdjacentHTML("beforeend",'')};
-this.init()};var C=function(g){if("string"!=typeof g){if(g instanceof Element)return[g];for(var e=[],a=$jscomp.makeIterator(g),c=a.next();!c.done;c=a.next())c=c.value,c instanceof Element&&e.push(c);return e}(g.match(/(#[0-9][^\s:,]*)/g)||[]).forEach(function(b){g=g.replace(b,'[id="'+b.replace("#","")+'"]')});return document.querySelectorAll(g)}})();
\ No newline at end of file
+!function(){"use strict";if(void 0!==window.lc_select)return!1;let t=[],e=!1,l=null,n=null;const s={enable_search:!0,min_for_search:7,autofocus_search:!1,wrap_width:"auto",addit_classes:[],pre_placeh_opt:!1,max_opts:!1,on_change:null,labels:["search options","add options","Select options ..",".. no matching options .."]};document.addEventListener("click",function(t){const e=document.querySelector("#lc-select-dd.lcslt-shown");if(!e)return!0;for(const e of document.getElementsByClassName("lcslt-wrap"))if(e.contains(t.target))return!0;return e.contains(t.target)||t.target.classList.contains("lcslt-shown")||(e.remove(),n&&(n.classList.remove("lcslt_dd-open"),n=null)),!0}),window.addEventListener("resize",function(t){const e=document.querySelector("#lc-select-dd.lcslt-shown");return!e||(!(!document.activeElement.hasAttribute("type")||"text"!==document.activeElement.getAttribute("type"))||(e.classList.remove("lcslt-shown"),n.classList.remove("lcslt_dd-open"),n=null,!0))}),window.addEventListener("scroll",t=>{document.querySelector(".lc-select-dd-scroll")&&e&&window.scrollTo(e[0],e[1])}),document.addEventListener("keydown",t=>{if(-1===[38,40,13,27,9].indexOf(t.keyCode)||!document.querySelector("#lc-select-dd.lcslt-shown"))return!0;t.preventDefault();const e=document.querySelector(".lcslt-dd-opt.lcslt-dd-opt-hlight"),l=document.querySelectorAll(".lcslt-dd-opt:not(.lcslt-disabled)"),s=new Event("mouseenter",{bubbles:!0});switch(t.keyCode){case 27:n.click();break;case 9:document.activeElement.classList&&document.activeElement.classList.contains("lcslt-tabindex-trick")||n.click();break;case 13:e&&(e.classList.remove("lcslt-dd-opt-hlight"),e.click());break;case 38:case 40:let i,o=38==t.keyCode?0:l.length-1;e&&l.forEach((t,l)=>{t==e&&(o=l)}),l[i=38==t.keyCode?o?o-1:l.length-1:o==l.length-1?0:o+1].dispatchEvent(s),c()}return!0});const c=()=>{const t=document.querySelector(".lcslt-dd-opt-hlight");if(!t)return!1;const e=parseInt(getComputedStyle(t).borderTopWidth,10);document.querySelector(".lc-select-dd-scroll").scrollTop=t.offsetTop-2*(t.offsetHeight+e)-10};window.lc_select=function(a,r={}){return a?"object"!=typeof r?console.error("Options must be an object"):(r=Object.assign({},s,r),this.init=function(){const t=this;l||(this.generate_style(),l=!0),i(a).forEach(function(e){"SELECT"==e.tagName&&(e.parentNode.classList.length&&e.parentNode.classList.contains("lcslt-wrap")||(t.wrap_element(e),e.removeEventListener("lc-select-refresh",()=>{}),e.addEventListener("lc-select-refresh",e=>{n&&n.click();const l=e.target.parentNode.querySelector(".lcslt");return t.set_sel_content(l),!(!e.target.parentNode.classList.length||e.target.parentNode.classList.length&&!e.target.parentNode.classList.contains("lcslt-wrap"))&&(e.target.disabled?l.classList.add("lcslt-disabled"):l.classList.remove("lcslt-disabled"),!0)}),e.removeEventListener("lc-select-destroy",()=>{}),e.addEventListener("lc-select-destroy",t=>{n&&n.click();const e=t.target,l=t.target.parentNode,s=e.querySelector('option[data-lcslt-placeh="1"]');return!(!l.classList.length||l.classList.length&&!l.classList.contains("lcslt-wrap"))&&(s&&s.remove(),l.parentNode.insertBefore(e,l),l.remove(),!0)})))})},this.wrap_element=function(t){const e=this,l=document.createElement("div"),n="lcslt-f-"+t.getAttribute("name").replace(/\[\]/g,""),s=t.disabled?"lcslt-disabled":"",c=t.multiple?"lcslt-multiple":"",i=t.getAttribute("tabindex")?parseInt(t.getAttribute("tabindex"),10):"";let o=t.hasAttribute("data-placeholder")?t.getAttribute("data-placeholder").trim():"";!o&&c&&(o=r.labels[2]),o=o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),"object"==typeof r.addit_classes&&r.addit_classes.some(t=>{l.classList.add(t)}),"auto"!=r.wrap_width&&(l.style.width="inherit"==r.wrap_width?Math.round(t.getBoundingClientRect().width)+"px":r.wrap_width),l.classList.add("lcslt-wrap",n),l.innerHTML='
',t.parentNode.insertBefore(l,t),l.appendChild(t);const a=l.querySelector(".lcslt");if(r.pre_placeh_opt&&!c&&o){let e=!0;if(t.querySelectorAll("option").forEach(t=>{if(t.hasAttribute("selected"))return e=!1,!1}),e){const e=document.createElement("option");e.setAttribute("data-lcslt-placeh",1),e.setAttribute("value",""),e.style.display="none",e.innerHTML=o,e.selected=!0,t.insertBefore(e,t.firstChild)}}this.set_sel_content(a),a.addEventListener("click",t=>{a.classList.contains("lcslt-disabled")||t.target.classList.contains("lcslt-multi-selected")||t.target.classList.contains("lcslt-max-opts")||t.target.parentNode.classList.contains("lcslt-multi-selected")||e.show_dd(a)}),l.querySelector(".lcslt-tabindex-trick").onfocus=(t=>{a.click()})},this.set_sel_content=function(t=!1){t||(t=n);const e=this,l=t.nextSibling,s=t.classList.contains("lcslt-multiple");let c="",i=0,a=0;l.querySelectorAll("option").forEach(t=>{if(t.selected){const e=t.hasAttribute("data-image")?' ":"",l=t.hasAttribute("data-icon")?' ':"",n=l.length?l:e;if(s)c+=''+n+t.innerHTML+"
";else{const e=r.pre_placeh_opt&&t.hasAttribute("data-lcslt-placeh")?'class="lcslt-placeholder"':"";c="'+n+t.innerHTML+" "}a++}i++});let d=!1;"number"==typeof r.max_opts&&r.max_opts>1&&(a>=r.max_opts?(t.classList.add("lcslt-max-opts"),d=!0):t.classList.remove("lcslt-max-opts")),c?s&&i>a&&!l.disabled&&!d&&(c+='+ '):c=''+t.getAttribute("data-placeh")+" ",t.innerHTML=c,s&&t.querySelectorAll(".lcslt-multi-selected").forEach(l=>{l.addEventListener("click",n=>{o(n.target,".lcslt").classList.contains("lcslt-disabled")||e.deselect_option(n,t,l)})})},this.show_dd=function(t){if(document.querySelector("#lc-select-dd")&&(document.querySelector("#lc-select-dd").remove(),n.classList.remove("lcslt_dd-open")),t==n)return n=null,!1;n=t,this.append_dd(),this.set_dd_position(),c();const e=this,l=document.querySelector("#lc-select-dd");l.classList.add("lcslt-shown"),t.classList.add("lcslt_dd-open"),setTimeout(()=>{t.getBoundingClientRect().x!=l.getBoundingClientRect().x&&e.set_dd_position()},10)},this.set_dd_position=function(){const t=document.querySelector("#lc-select-dd"),e=n.getBoundingClientRect(),l=e.width.toFixed(2),s=parseInt(n.clientHeight,10)+parseInt(getComputedStyle(n).borderTopWidth,10),c=parseInt(e.y,10)+parseInt(window.pageYOffset,10)+s;let i=e.left.toFixed(2);i<0&&(i=0),t.setAttribute("style","width:"+l+"px; top:"+c+"px; left: "+i+"px;")},this.append_dd=function(){const t=this,l=n.parentNode.querySelector("select");let s=new Map,c=!1,i=[];l.querySelectorAll("optgroup").length?l.querySelectorAll("optgroup").forEach(t=>{s.set(t.getAttribute("label"),new Map),t.disabled&&i.push(t.getAttribute("label"))}):(c=!0,s.set("%%lcslt%%",new Map)),l.querySelectorAll("option").forEach(t=>{let e={img:t.hasAttribute("data-image")?t.getAttribute("data-image").trim():"",icon:t.hasAttribute("data-icon")?t.getAttribute("data-icon").trim():"",name:t.innerHTML,selected:t.selected,disabled:t.disabled};const l=c?"%%lcslt%%":t.parentNode.getAttribute("label");(c||l)&&s.get(l).set(t.getAttribute("value"),e)});const o=n.classList.contains("lcslt-multiple")?"lcslt-multiple-dd":"",a="object"==typeof r.addit_classes?r.addit_classes.join(" "):"";let d='';const u=!!(r.enable_search&&l.querySelectorAll("option").length>=parseInt(r.min_for_search,10));u&&(d+='
'),d+='
"),document.querySelectorAll(".lcslt-dd-opt").forEach(e=>{e.addEventListener("click",l=>{t.clicked_dd_option(l,e)}),e.addEventListener("mouseenter",t=>{document.querySelector(".lcslt-dd-opt-hlight")&&document.querySelector(".lcslt-dd-opt-hlight").classList.remove("lcslt-dd-opt-hlight"),e.classList.contains("lcslt-disabled")||e.classList.add("lcslt-dd-opt-hlight")}),e.addEventListener("mouseleave",t=>{e.classList.remove("lcslt-dd-opt-hlight")})}),u&&(window.innerWidth>1024&&r.autofocus_search&&setTimeout(()=>document.querySelector("input[name=lcslt-search]").focus(),50),document.querySelector("input[name=lcslt-search]").addEventListener("keyup",t=>{this.debounce("opts_search",500,"search_options")})),document.querySelector(".lc-select-dd-scroll").addEventListener("mouseenter",()=>{e=[window.pageXOffset,window.pageYOffset]}),document.querySelector(".lc-select-dd-scroll").addEventListener("mouseleave",()=>{e=!1})},this.on_val_change=function(t){const e=t.nextSibling,l=Array.from(e.selectedOptions).map(t=>t.value),n=new Event("change",{bubbles:!0});e.dispatchEvent(n),"function"==typeof r.on_change&&r.on_change.call(this,l,e)},this.deselect_option=function(t,e,l){e.nextSibling.querySelector('option[value="'+l.getAttribute("data-val")+'"]').selected=!1,this.set_sel_content(e),this.on_val_change(e)},this.clicked_dd_option=function(t,e){const l=n.classList.contains("lcslt-multiple"),s=e.getAttribute("data-val"),c=n.nextSibling;if(e.classList.contains("lcslt-disabled")||!l&&e.classList.contains("lcslt-selected")||!e.classList.contains("lcslt-selected")&&n.classList.contains("lcslt-max-opts"))return!1;l||(document.querySelectorAll(".lcslt-dd-opt").forEach(t=>{t.getAttribute("data-val")!=s&&t.classList.remove("lcslt-selected")}),c.querySelectorAll("option").forEach(t=>{t.getAttribute("value")!=s&&(t.selected=!1)})),e.classList.toggle("lcslt-selected"),e.classList.remove("lcslt-dd-opt-hlight"),c.querySelector('option[value="'+s+'"]').selected=!c.querySelector('option[value="'+s+'"]').selected,this.set_sel_content(),this.on_val_change(n),l?this.set_dd_position():n.click()},this.search_options=function(){if(!document.querySelector("input[name=lcslt-search]"))return!1;const t=document.querySelector("input[name=lcslt-search]").value.trim(),e=document.querySelectorAll(".lcslt-group-name"),l=document.querySelectorAll(".lcslt-dd-opt"),n=document.querySelector(".lcslt-no-results");if(t.length<2)document.getElementById("lc-select-dd").classList.remove("lcslt-is-searching"),e.forEach(t=>{t.style.removeProperty("display")}),l.forEach(t=>{t.style.removeProperty("display")}),n&&n.remove();else{document.getElementById("lc-select-dd").classList.add("lcslt-is-searching"),e.forEach(t=>{t.style.display="none"});const s=t.split(" ");let c=!0;l.forEach(t=>{let e=!1;s.some(l=>{-1!==t.querySelector("span").innerHTML.toLowerCase().indexOf(l.toLowerCase())&&(e=!0,c=!1)}),e?t.style.removeProperty("display"):t.style.display="none"}),c?n||document.querySelector(".lc-select-dd-scroll").insertAdjacentHTML("beforeend",''+r.labels[3]+" "):n.remove()}},this.debounce=function(e,l,n,s){void 0!==t[e]&&t[e]&&clearTimeout(t[e]);const c=this;t[e]=setTimeout(()=>{c[n].call(c,s)},l)},this.generate_style=function(){const t=" url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNTg3LjQ3MXB4IiBoZWlnaHQ9IjU4Ny40NzFweCIgdmlld0JveD0iMCAwIDU4Ny40NzEgNTg3LjQ3MSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTg3LjQ3MSA1ODcuNDcxOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGc+PGc+PHBhdGggZD0iTTIyMC4zMDIsNDQwLjYwNGMxMjEuNDc2LDAsMjIwLjMwMi05OC44MjYsMjIwLjMwMi0yMjAuMzAyQzQ0MC42MDQsOTguODI2LDM0MS43NzcsMCwyMjAuMzAyLDBDOTguODI2LDAsMCw5OC44MjYsMCwyMjAuMzAyQzAsMzQxLjc3Nyw5OC44MjYsNDQwLjYwNCwyMjAuMzAyLDQ0MC42MDR6IE0yMjAuMzAyLDcxLjE0MmM4Mi4yNDcsMCwxNDkuMTU5LDY2LjkxMywxNDkuMTU5LDE0OS4xNTljMCw4Mi4yNDgtNjYuOTEyLDE0OS4xNi0xNDkuMTU5LDE0OS4xNnMtMTQ5LjE2LTY2LjkxMi0xNDkuMTYtMTQ5LjE2QzcxLjE0MiwxMzguMDU1LDEzOC4wNTUsNzEuMTQyLDIyMC4zMDIsNzEuMTQyeiIvPjxwYXRoIGQ9Ik01MjUuNTIzLDU4Ny40NzFjMTYuNTU1LDAsMzIuMTEzLTYuNDQ3LDQzLjgwMS0xOC4xNThjMTEuNjk5LTExLjY4LDE4LjE0Ni0yNy4yMzQsMTguMTQ2LTQzLjc5MWMwLTE2LjU1My02LjQ0Ny0zMi4xMTUtMTguMTUyLTQzLjgyMkw0NDYuNjQzLDM1OS4wMjNjLTMuMjYyLTMuMjYyLTcuNDc1LTUuMDYxLTExLjg1OS01LjA2MWMtNS40NDksMC0xMC40NjUsMi43MTEtMTMuNzYyLDcuNDM4Yy0xNi4yMzgsMjMuMzE4LTM2LjI5Nyw0My4zNzctNTkuNjEzLDU5LjYxNWMtNC4yNTgsMi45NjUtNi45NDcsNy40NjctNy4zNzksMTIuMzUyYy0wLjQyOCw0LjgyOCwxLjM5Myw5LjY2Niw0Ljk5OCwxMy4yN2wxMjIuNjc0LDEyMi42NzZDNDkzLjQwNiw1ODEuMDIzLDUwOC45NjksNTg3LjQ3MSw1MjUuNTIzLDU4Ny40NzF6Ii8+PC9nPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48L3N2Zz4=')";document.head.insertAdjacentHTML("beforeend",``)},void this.init()):console.error("You must provide a valid selector or DOM object as first argument")};const i=t=>{if("string"!=typeof t){if(t instanceof Element)return[t];{let e=[];for(const l of t)l instanceof Element&&e.push(l);return e}}return(t.match(/(#[0-9][^\s:,]*)/g)||[]).forEach(function(e){t=t.replace(e,'[id="'+e.replace("#","")+'"]')}),document.querySelectorAll(t)},o=(t,e)=>{let l=t;for(;null!=l.parentNode&&!l.matches(e);)l=l.parentNode;return l}}();
\ No newline at end of file
diff --git a/themes/dark.css b/themes/dark.css
index 60cc7a3..ce0738c 100644
--- a/themes/dark.css
+++ b/themes/dark.css
@@ -177,9 +177,14 @@
/* images */
-.lcslt-img {
+.lcslt-img, .lcslt-icon {
display: inline-block;
height: 17px;
width: 20px;
margin-right: 7px;
}
+
+.lcslt-icon {
+ vertical-align: middle;
+ font-size: 17px;
+}
\ No newline at end of file
diff --git a/themes/dark_prefixed.css b/themes/dark_prefixed.css
index 78bbe89..5bd06c4 100644
--- a/themes/dark_prefixed.css
+++ b/themes/dark_prefixed.css
@@ -177,9 +177,14 @@
/* images */
-.lcslt-dark .lcslt-img {
+.lcslt-dark .lcslt-img, .lcslt-dark .lcslt-icon {
display: inline-block;
height: 17px;
width: 20px;
margin-right: 7px;
}
+
+.lcslt-dark .lcslt-icon {
+ vertical-align: middle;
+ font-size: 17px;
+}
\ No newline at end of file
diff --git a/themes/light.css b/themes/light.css
index 526f422..a26c9a9 100644
--- a/themes/light.css
+++ b/themes/light.css
@@ -176,9 +176,14 @@
/* images */
-.lcslt-img {
+.lcslt-img, .lcslt-icon {
display: inline-block;
height: 17px;
width: 20px;
margin-right: 7px;
}
+
+.lcslt-icon {
+ vertical-align: middle;
+ font-size: 17px;
+}
\ No newline at end of file
diff --git a/themes/light_prefixed.css b/themes/light_prefixed.css
index 6abc808..411420e 100644
--- a/themes/light_prefixed.css
+++ b/themes/light_prefixed.css
@@ -176,9 +176,14 @@
/* images */
-.lcslt-light .lcslt-img {
+.lcslt-light .lcslt-img, .lcslt-light .lcslt-icon {
display: inline-block;
height: 17px;
width: 20px;
margin-right: 7px;
}
+
+.lcslt-light .lcslt-icon {
+ vertical-align: middle;
+ font-size: 17px;
+}
\ No newline at end of file