Commit fbf1fd81 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

correctif : il existait des doublons d'id entre les noeuds de la nav bar et le contenu texte

parent 21136517
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ declare function max.html:getFooter($project){
declare function max.html:getNavbarForDocument($project, $doc, $selectedId){

    let $xml := max.toc:getDocumentTOC($project, $doc) (:max.route:getRouteNavigationEntriesAsHTML($project, $routeId):)
    let $hasTarget := $xml//ul//li[@id=$selectedId]
    let $hasTarget := $xml//ul//li[@data-target=$selectedId]
    return if (count($xml//ul/li) > 1 and $hasTarget)
    then
        xslt:transform($xml,
+3 −2
Original line number Diff line number Diff line
@@ -109,9 +109,10 @@ class MaxTEI extends AbstractMax {
    bindNavigationTool() {
        //local function : find next or previous nav link
        let nextOrPrevious = function (step) {
            let current = $("#navigation-tool").find('button').attr("id").replace("selected-", "");//remove 'selected' prefix
            let current = $("#navigation-tool").find('button').attr("data-target").replace("selected-", "");//remove 'selected' prefix
            let links = $('#dropdown-navigation').find('li');
            let position = links.index(document.getElementById(current));
            let position = links.index(document.querySelector('li[data-target='+current+']'));
            console.log(position);
            let nextOrPrevious = links.get(position + step);
            window.location.href = $(nextOrPrevious).find('a').attr("href");
        };
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

    <xsl:template match="tei:li">
        <li>
            <xsl:attribute name="id">
            <xsl:attribute name="data-target">
                <xsl:value-of select="@id"/>
            </xsl:attribute>
            <xsl:apply-templates/>
+2 −1
Original line number Diff line number Diff line
@@ -28,11 +28,12 @@
            <button
                    class="btn btn-default dropdown-toggle"
                    type="button"
                    data-target="selected-{$selectedId}"
                    id="selected-{$selectedId}"
                    data-toggle="dropdown"
                    aria-haspopup="true"
                    aria-expanded="true">
                <xsl:apply-templates select=".//li[@id = $selectedId]/a"/>
                <xsl:apply-templates select=".//li[@data-target = $selectedId]/a"/>
            </button>

            <ul id="dropdown-navigation" class="dropdown-menu" aria-labelledby="selected-{$selectedId}">