Skip to content

Commit

Permalink
Remove unnecessary code in ElectricAPIBundle | Fixes liferay#657
Browse files Browse the repository at this point in the history
  • Loading branch information
matuzalemsteles committed Mar 16, 2018
1 parent 8289e68 commit 27c3d12
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions packages/clayui.com/src/partials/ElectricAPIBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,21 @@ class ElectricApiBundle extends Component {
input: document.querySelector('input[name="query"]')
});

this.dropdowns_ = new Toggler({
content: '.version-dropdown .dropdown-menu',
header: '.version-dropdown .btn'
});
Toggler.CSS_EXPANDED = 'open';

this.toggler_ = new Toggler({
content: '.sidebar-toggler-content',
header: '.sidebar-header'
header: '.sidebar-toggler'
});

this.docClickHandler_ = dom.on(document, 'click', this.handleDocClick_.bind(this));
}

disposed() {
if (isServerSide()) {
return;
}

this.docClickHandler_.removeListener();
this.dropdowns_.dispose();
this.toggler_.dispose();
}

handleDocClick_(event) {
if (!dom.parent(event.target, '.version-dropdown')) {
let expanded = document.querySelector('.toggler-header-expanded');

if (expanded) {
this.dropdowns_.toggle(expanded);
}
}
}
}

ElectricApiBundle.STATE = {
Expand Down

0 comments on commit 27c3d12

Please sign in to comment.