Skip to content
Snippets Groups Projects
Commit 14adfc06 authored by Marius Dumitru Florea's avatar Marius Dumitru Florea
Browse files

XWIKI-12921: Expanding tree's child nodes closes the dropdown after the...

XWIKI-12921: Expanding tree's child nodes closes the dropdown after the breadcrumb nodes have been expanded
parent 677bdbf4
No related branches found
No related tags found
No related merge requests found
......@@ -23,9 +23,9 @@
*/
require(['jquery', 'xwiki-events-bridge'], function($) {
'use strict';
$(document).ready(function() {
/**
* Function that expand a breadcumb on some events.
*/
......@@ -52,7 +52,7 @@ require(['jquery', 'xwiki-events-bridge'], function($) {
ellipsis.removeClass('loading');
});
};
/**
* Add a link to expand breadcrumbs.
*/
......@@ -67,14 +67,14 @@ require(['jquery', 'xwiki-events-bridge'], function($) {
}
});
};
addExpandLinkToBreadcrumbs();
// Initialize breadcrumbs on livetable refresh (because now livetables could have breadcrumbs to display locations)
$(document).on('xwiki:livetable:displayComplete', addExpandLinkToBreadcrumbs);
});
});
/**
......@@ -82,11 +82,6 @@ require(['jquery', 'xwiki-events-bridge'], function($) {
*/
require(["$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'require-config.min.js', {'evaluate': true})"], function() {
require(['tree', 'bootstrap'], function($) {
$('ol.breadcrumb > li.dropdown > .dropdown-menu').click(function(event) {
// Prevent the drop-down from closing when the user expands the tree nodes.
event.stopPropagation();
});
var enhanceBreadcrumb = function(breadcrumb) {
breadcrumb.children('li.dropdown').on('shown.bs.dropdown', function(event) {
$(this).find('.dropdown-menu > .breadcrumb-tree').each(function() {
......@@ -99,6 +94,9 @@ require(["$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar'
});
}
});
}).children('.dropdown-menu').click(function(event) {
// Prevent the drop-down from closing when the user expands the tree nodes.
event.stopPropagation();
});
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment