Commit 73351789 authored by Ahmed El Gabri's avatar Ahmed El Gabri

Don't set height on innerList

* Rename `AppTabs.adjustHeight` to `AppTabs.switchTab`
* Remove height set by JavaScript, to let the elements flow normally
parent d1d153f8
......@@ -207,15 +207,14 @@
var isSelected = el.dataset.appList === selected;
el.style.display = isSelected ? 'block' : 'none';
if (isSelected) {
this.adjustHeight(el);
this.switchTab(el);
}
}.bind(this)
);
};
AppTabs.prototype.adjustHeight = function (e) {
AppTabs.prototype.switchTab = function (e) {
var list = e.querySelector(AppTabs.selectors.innerList);
list.style.height = this.listHeight + 'px';
var $clone = $(list)
.clone()
.css({ visibility: 'hidden' })
......@@ -223,9 +222,7 @@
.appendTo(list.parentElement);
window.requestAnimationFrame(function () {
var naturalHeight = this.listHeight = $clone.outerHeight();
$clone.remove();
list.style.height = naturalHeight + 'px';
}.bind(this));
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment