mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
tabs feature, data sent from controller.
This commit is contained in:
@@ -58,6 +58,20 @@ let setPaneHeight = function(contents)
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if links are defined in controller
|
||||
* If true, disable javascript listener
|
||||
*/
|
||||
let isLinkRef = function(link) {
|
||||
|
||||
if (link.getAttribute('href') == "#") {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Main function
|
||||
*/
|
||||
@@ -82,17 +96,19 @@ window.addEventListener('load', function()
|
||||
}
|
||||
|
||||
setPaneHeight(contents);
|
||||
|
||||
|
||||
// initial position
|
||||
setNewActive(links, contents, unit.startPanel);
|
||||
|
||||
// listen
|
||||
links.forEach(function(link) {
|
||||
link.addEventListener('click', function()
|
||||
{
|
||||
resetActive(links, contents);
|
||||
setNewActive(links, contents, countNewActive(links, link));
|
||||
});
|
||||
if (isLinkRef(link) == false) {
|
||||
link.addEventListener('click', function()
|
||||
{
|
||||
resetActive(links, contents);
|
||||
setNewActive(links, contents, countNewActive(links, link));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user