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 @@ ...@@ -207,15 +207,14 @@
var isSelected = el.dataset.appList === selected; var isSelected = el.dataset.appList === selected;
el.style.display = isSelected ? 'block' : 'none'; el.style.display = isSelected ? 'block' : 'none';
if (isSelected) { if (isSelected) {
this.adjustHeight(el); this.switchTab(el);
} }
}.bind(this) }.bind(this)
); );
}; };
AppTabs.prototype.adjustHeight = function (e) { AppTabs.prototype.switchTab = function (e) {
var list = e.querySelector(AppTabs.selectors.innerList); var list = e.querySelector(AppTabs.selectors.innerList);
list.style.height = this.listHeight + 'px';
var $clone = $(list) var $clone = $(list)
.clone() .clone()
.css({ visibility: 'hidden' }) .css({ visibility: 'hidden' })
...@@ -223,9 +222,7 @@ ...@@ -223,9 +222,7 @@
.appendTo(list.parentElement); .appendTo(list.parentElement);
window.requestAnimationFrame(function () { window.requestAnimationFrame(function () {
var naturalHeight = this.listHeight = $clone.outerHeight();
$clone.remove(); $clone.remove();
list.style.height = naturalHeight + 'px';
}.bind(this)); }.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