Skip to content

Commit

Permalink
Clean up '_setDropdown' method
Browse files Browse the repository at this point in the history
  • Loading branch information
grafluxe committed Dec 11, 2017
1 parent f9b314f commit 2b00dec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Dropdownizer.js
Expand Up @@ -294,14 +294,15 @@ class Dropdownize {
}

_setDropdown() {
let pad = 0;
let computedStyles = window.getComputedStyle(this._el),
divWidth = this._el.offsetWidth;

if (this._touchable && window.getComputedStyle(this._el)["min-width"] === "0px") {
pad = 9;
if (this._touchable && computedStyles.minWidth === "0px") {
divWidth += 9;
}

this._ui.div.dropdownizer = this;
this._ui.div.style.width = this._el.offsetWidth + pad + "px";
this._ui.div.style.width = divWidth + "px";
this._ui.div.classList = this._el.classList;
this._ui.div.classList.add("dropdownizer");

Expand Down

0 comments on commit 2b00dec

Please sign in to comment.