summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-07-11 16:38:56 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-07-28 10:18:44 +0200
commit4059aa12a4487c925472751b132842bdb0b16a02 (patch)
treee976b11f55a15819774106757eac7b86c266652e
parent855c59c7fcbeaa8f1caff6c3e5c61b0524eab53d (diff)
downloadfreeipa-4059aa12a4487c925472751b132842bdb0b16a02.tar.gz
freeipa-4059aa12a4487c925472751b132842bdb0b16a02.tar.xz
freeipa-4059aa12a4487c925472751b132842bdb0b16a02.zip
webui: fix nested items creation in dropdown list
Items nested in other items were created in root list instead of nested list. Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
-rw-r--r--install/ui/src/freeipa/widgets/DropdownWidget.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/install/ui/src/freeipa/widgets/DropdownWidget.js b/install/ui/src/freeipa/widgets/DropdownWidget.js
index 181cfc5cf..1f925a80a 100644
--- a/install/ui/src/freeipa/widgets/DropdownWidget.js
+++ b/install/ui/src/freeipa/widgets/DropdownWidget.js
@@ -191,7 +191,7 @@ define(['dojo/_base/declare',
_itemsSetter: function(value) {
this._clear_items();
this.items = value;
- this._render_items(this.items, this.dom_node);
+ this._render_items(this.items);
},
_clear_items: function() {
@@ -201,9 +201,9 @@ define(['dojo/_base/declare',
}
},
- _render_list: function(container) {
+ _render_list: function(container, nested) {
- var ul = this.ul_node = construct.create('ul', {
+ var ul = construct.create('ul', {
'class': 'dropdown-menu'
});
if (this.right_aligned) {
@@ -212,14 +212,15 @@ define(['dojo/_base/declare',
if (container) {
construct.place(ul, container);
}
+ if (!nested) this.ul_node = ul;
return ul;
},
_render_items: function(items, container) {
- var ul = this.ul_node;
+ if (!container) container = this.ul_node;
array.forEach(items, function(item) {
- this._render_item(item, ul);
+ this._render_item(item, container);
}, this);
},
@@ -257,7 +258,8 @@ define(['dojo/_base/declare',
if (item.items && item.items.length > 0) {
dom_class.add(li, 'dropdown-submenu');
- this._render_items(item.items, li);
+ var ul = this._render_list(li, true);
+ this._render_items(item.items, ul);
} else {
on(a, 'click', lang.hitch(this, function(event) {
this.on_item_click(event, item);