jsdialog: keep icons column in line with header
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I2ed3b97dced0e0be686a602de9dda05a3322745e
This commit is contained in:
parent
82205c98e1
commit
b70f6e6213
1 changed files with 10 additions and 0 deletions
|
@ -224,11 +224,21 @@ function _headerlistboxEntry(parentContainer, treeViewData, entry, builder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _hasIcon(columns) {
|
||||||
|
for (var i in columns)
|
||||||
|
if (columns[i].collapsed !== undefined)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function _createHeaders(tbody, data, builder) {
|
function _createHeaders(tbody, data, builder) {
|
||||||
var headers = L.DomUtil.create('tr', builder.options.cssClass + ' ui-treeview-header', tbody);
|
var headers = L.DomUtil.create('tr', builder.options.cssClass + ' ui-treeview-header', tbody);
|
||||||
var hasCheckboxes = data.entries && data.entries.length && data.entries[0].state !== undefined;
|
var hasCheckboxes = data.entries && data.entries.length && data.entries[0].state !== undefined;
|
||||||
if (hasCheckboxes)
|
if (hasCheckboxes)
|
||||||
data.headers = [{ text: '' }].concat(data.headers);
|
data.headers = [{ text: '' }].concat(data.headers);
|
||||||
|
var hasIcons = data.entries && data.entries.length && _hasIcon(data.entries[0].columns);
|
||||||
|
if (hasIcons)
|
||||||
|
data.headers = [{ text: '' }].concat(data.headers);
|
||||||
for (var h in data.headers) {
|
for (var h in data.headers) {
|
||||||
var header = L.DomUtil.create('th', builder.options.cssClass, headers);
|
var header = L.DomUtil.create('th', builder.options.cssClass, headers);
|
||||||
var headerText = L.DomUtil.create('span', builder.options.cssClass + ' ui-treeview-header-text', header);
|
var headerText = L.DomUtil.create('span', builder.options.cssClass + ' ui-treeview-header-text', header);
|
||||||
|
|
Loading…
Reference in a new issue