dasch-swiss / beol

Bernoulli-Euler OnLine
https://beol.dasch.swiss
GNU Affero General Public License v3.0
0 stars 1 forks source link

BEBB: letter footnote #123

Open tobiasschweizer opened 5 years ago

tobiasschweizer commented 5 years ago

Go to footnote: jumps to the wrong footnote.

tobiasschweizer commented 5 years ago

src/app/directives/mathjax.directive.ts:

if (this._bindEvents && targetElement.parentElement.nodeName.toLowerCase() === 'a'
            && targetElement.parentElement.className.toLowerCase().indexOf(KnoraConstants.RefMarker) >= 0) {

            // internal reference in a BEBB letter: scroll to footnote on page

            const indexOfHashtag = targetElement.parentElement.href.indexOf('#', '');

            if (indexOfHashtag !== -1) {

                const targetId = targetElement.parentElement.href.substr(indexOfHashtag + 1);

                const targetEle = document.getElementById(targetId);

                if (targetEle) {
                    targetEle.scrollIntoView();
                }

            }

            // preventDefault (propagation)
            return false;