Commit 05ea773a authored by jeromecambon's avatar jeromecambon Committed by benjaminParisel

fix(fragment_panel_update) : update the fragment panel when a fragment is created (#2722)

* Added broadcast message to notify fragment creation. Fixed issue in fragments metadata.
Fix bug [UID-82](https://bonitasoft.atlassian.net/browse/UID-82)

* Fix test fail
parent 98fe047c
......@@ -49,15 +49,21 @@
this.isClosed = isClosed;
this.getIconClassName = getIconClassName;
this.isFragment = isFragment;
this.updateSections = updateSections;
resize();
$scope.$on('fragmentCreated', function() {
// Update fragments section
updateSections();
});
function toggleSection(section) {
palette.currentSection = palette.currentSection === section ? undefined : section;
resize();
}
function isActiveSection(section) {
return palette.currentSection === section;
return palette.currentSection && palette.currentSection.name === section.name;
}
function resize() {
......@@ -77,6 +83,16 @@
function getIconClassName(section) {
return 'ui-' + section.name.replace(/ /g, ''); // remove white spaces
}
function updateSections() {
palette.sections = paletteService.getSections();
palette.sections.forEach(section => {
if (isActiveSection(section)) {
palette.currentSection = section;
}
});
resize();
}
}
})();
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