Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
grafluxe committed Nov 25, 2017
1 parent 4844662 commit fca0cab
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/Dropdownizer.js
Expand Up @@ -4,7 +4,7 @@
* @license MIT
*/

class Dropdownizer{
class Dropdownizer {

constructor(el) {
let dds = [];
Expand Down Expand Up @@ -213,6 +213,20 @@ class Dropdownize {
this._closeList();
}

_addToDOM() {
this._el.parentNode.insertBefore(this._ui.div, this._el.nextSibling);

if (this._el.id) {
this._origId = this._el.id;

this._ui.div.id = this._el.id;
this._el.id = "__" + this._el.id;
}

this._origClasses = this._el.classList.toString();
this._el.classList = "dd-x";
}

selectItem(index) {
let listItem = this._listItems[index];

Expand Down Expand Up @@ -253,20 +267,6 @@ class Dropdownize {
return this;
}

_addToDOM() {
this._el.parentNode.insertBefore(this._ui.div, this._el.nextSibling);

if (this._el.id) {
this._origId = this._el.id;

this._ui.div.id = this._el.id;
this._el.id = "__" + this._el.id;
}

this._origClasses = this._el.classList.toString();
this._el.classList = "dd-x";
}

change(callback) {
this._changeCallback = callback;
return this;
Expand Down

0 comments on commit fca0cab

Please sign in to comment.